Posted in
Virtual Machine Manager,
Windows Powershell |
No Comment | 1,794 views | 17/06/2009 10:53
Checking System Center Virtual Machine Manager (SCVMM) User Role before creating would be better. Nobody wants to get errors when deploying virtual machines. Checking SCVMM user role is so simple:
1
2
3
4
5
6
7
8
9
10
| $UserRole = "blabla"
$checkvmmuser = Get-VMMUserRole $UserRole
if ($checkvmmuser.Profile -eq "SelfServiceUser")
{
Write-Host "That User Role already exist."
}
else
{
.\createvmmuser.ps1 "FirstName" "LastName" "SamID"
} |
$UserRole = "blabla"
$checkvmmuser = Get-VMMUserRole $UserRole
if ($checkvmmuser.Profile -eq "SelfServiceUser")
{
Write-Host "That User Role already exist."
}
else
{
.\createvmmuser.ps1 "FirstName" "LastName" "SamID"
}
I don’t know any other way to check SCVMM User Role. But this is the best so far.