Posted in
Virtual Machine Manager,
Windows Powershell |
No Comment | 6,690 views | 04/02/2014 14:16
You can use following script to set domain join user credentials to SCVMM 2012/R2 templates.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| # Get Templates
$Templates = Get-SCVMTemplate
# Set Domain
$Domain = "domain.domain.com"
# Get Credentials
$DomainJoinCredential = Get-Credential
# Set Templates
foreach ($Template in $Templates)
{
$Template | Set-SCVMTemplate -Domain $Domain -DomainJoinCredential $DomainJoinCredential
} |
# Get Templates
$Templates = Get-SCVMTemplate
# Set Domain
$Domain = "domain.domain.com"
# Get Credentials
$DomainJoinCredential = Get-Credential
# Set Templates
foreach ($Template in $Templates)
{
$Template | Set-SCVMTemplate -Domain $Domain -DomainJoinCredential $DomainJoinCredential
}
You should change domain name as your current domain name.