Posted in
Virtual Machine Manager,
Windows Powershell |
No Comment | 5,910 views | 12/10/2012 11:55
1. How to create RunAs Account?
1
2
3
| $SecurePassword = ConvertTo-SecureString "P@ssw0rd!" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "yusufozturk\Administrator", $SecurePassword
New-SCRunAsAccount -Name "Domain Admin" -Credential $Credential |
$SecurePassword = ConvertTo-SecureString "P@ssw0rd!" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "yusufozturk\Administrator", $SecurePassword
New-SCRunAsAccount -Name "Domain Admin" -Credential $Credential
2. How to get RunAs Account?
1
| Get-SCRunAsAccount -Name "Domain Admin" |
Get-SCRunAsAccount -Name "Domain Admin"
3. How to remove RunAs Account?
1
| Get-SCRunAsAccount -Name "Domain Admin" | Remove-SCRunAsAccount |
Get-SCRunAsAccount -Name "Domain Admin" | Remove-SCRunAsAccount
Posted in
Virtual Machine Manager,
Windows Powershell |
No Comment | 10,812 views | 13/10/2009 00:36
You can add untrusted domain host to System Center Virtual Machine Manager 2008 R2 (SCVMM 2008 R2) with Powershell using:
$Credential = get-credential
$VMHostGroup = Get-VMHostGroup -VMMServer localhost | where {$_.Path -eq "All Hosts"}
Add-VMHost -VMMServer localhost -ComputerName "hyperv02.yusufozturk.info"
-Description "" -Credential $Credential -RemoteConnectEnabled $true -VmPaths ""
-Reassociate $true -RunAsynchronously -NonTrustedDomainHost -VMHostGroup $VMHostGroup |
$Credential = get-credential
$VMHostGroup = Get-VMHostGroup -VMMServer localhost | where {$_.Path -eq "All Hosts"}
Add-VMHost -VMMServer localhost -ComputerName "hyperv02.yusufozturk.info"
-Description "" -Credential $Credential -RemoteConnectEnabled $true -VmPaths ""
-Reassociate $true -RunAsynchronously -NonTrustedDomainHost -VMHostGroup $VMHostGroup
You can find an example about $Credential in this blog.