-
Notifications
You must be signed in to change notification settings - Fork 41
VMHostAccount
SimeonGerginov edited this page Oct 30, 2019
·
4 revisions
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Server | Key | string | Name of the Server we are trying to connect to. The Server can only be ESXi. | |
Credential | Mandatory | PSCredential | Credentials needed for connection to the specified Server. | |
Id | Key | string | Specifies the ID for the host account. | |
Ensure | Mandatory | Ensure | Value indicating if the Resource should be Present or Absent. | Present, Absent |
Role | Mandatory | string | Permission on the VMHost entity is created for the specified User Id with the specified Role. | |
AccountPassword | Optional | string | Specifies the Password for the host account. | |
Description | Optional | string | Provides a description for the host account. The maximum length of the text is 255 symbols. |
The resource is used to create, update and delete VMHost Accounts in the specified VMHost we are connected to.
Creates a new VMHostAccount in the specified VMHost we are connected to. The Resource also creates new 'Admin' Role Permission for the newly created VMHostAccount.
param(
[Parameter(Mandatory = $true)]
[string]
$Server,
[Parameter(Mandatory = $true)]
[string]
$User,
[Parameter(Mandatory = $true)]
[string]
$Password
)
$script:configurationData = @{
AllNodes = @(
@{
NodeName = 'localhost'
PSDscAllowPlainTextPassword = $true
}
)
}
Configuration VMHostAccount_WithAccountToAdd_Config {
Import-DscResource -ModuleName VMware.vSphereDSC
Node localhost {
$Password = $Password | ConvertTo-SecureString -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential($User, $Password)
VMHostAccount vmHostAccount {
Server = $Server
Credential = $Credential
Id = 'MyVMHostAccount'
Ensure = 'Present'
Role = 'Admin'
AccountPassword = 'MyAccountPass1!'
Description = 'MyVMHostAccount Description'
}
}
}
Removes the VMHost Account in the specified VMHost we are connected to.
param(
[Parameter(Mandatory = $true)]
[string]
$Server,
[Parameter(Mandatory = $true)]
[string]
$User,
[Parameter(Mandatory = $true)]
[string]
$Password
)
$script:configurationData = @{
AllNodes = @(
@{
NodeName = 'localhost'
PSDscAllowPlainTextPassword = $true
}
)
}
Configuration VMHostAccount_WithAccountToRemove_Config {
Import-DscResource -ModuleName VMware.vSphereDSC
Node localhost {
$Password = $Password | ConvertTo-SecureString -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential($User, $Password)
VMHostAccount vmHostAccount {
Server = $Server
Credential = $Credential
Id = 'MyVMHostAccount'
Ensure = 'Absent'
Role = 'Admin'
}
}
}
- Home
- Tips & Tricks
- Cluster
- DRSRule
- Datacenter
- DatacenterFolder
- DatastoreCluster
- DatastoreClusterAddDatastore
- DrsCluster
- Folder
- HACluster
- NfsDatastore
- NfsUser
- PowerCLISettings
- StandardPortGroup
- StandardSwitch
- VDPortGroup
- VDSwitch
- VDSwitchVMHost
- VMHostAcceptanceLevel
- VMHostAccount
- VMHostAdvancedSettings
- VMHostAgentVM
- VMHostAuthentication
- VMHostCache
- VMHostConfiguration
- VMHostDCUIKeyboard
- VMHostDnsSettings
- VMHostFirewallRuleset
- VMHostGraphics
- VMHostGraphicsDevice
- VMHostIPRoute
- VMHostIScsiHba
- VMHostIScsiHbaTarget
- VMHostIScsiHbaVMKernelNic
- VMHostNetworkCoreDump
- VMHostNtpSettings
- VMHostPciPassthrough
- VMHostPermission
- VMHostPhysicalNic
- VMHostPowerPolicy
- VMHostRole
- VMHostSNMPAgent
- VMHostSatpClaimRule
- VMHostScsiLun
- VMHostScsiLunPath
- VMHostService
- VMHostSettings
- VMHostSharedSwapSpace
- VMHostSoftwareDevice
- VMHostStorage
- VMHostSyslog
- VMHostTpsSettings
- VMHostVDSwitchMigration
- VMHostVMKernelActiveDumpFile
- VMHostVMKernelActiveDumpPartition
- VMHostVMKernelDumpFile
- VMHostVMKernelModule
- VMHostVdsNic
- VMHostVss
- VMHostVssBridge
- VMHostVssMigration
- VMHostVssNic
- VMHostVssPortGroup
- VMHostVssPortGroupSecurity
- VMHostVssPortGroupShaping
- VMHostVssPortGroupTeaming
- VMHostVssSecurity
- VMHostVssShaping
- VMHostVssTeaming
- VMHostvSANNetworkConfiguration
- VmfsDatastore
- vCenterSettings
- vCenterStatistics
- vCenterVMHost