Saturday, October 17, 2009

DisplayComputerRoles.ps1

# This is a example taken from the book "Microsoft Windows Powershell Step by step"




$wmi = get-wmiobject win32_computersystem
"computer " + $wmi.name + " is: "
switch ($wmi.domainrole)
{
0 {"`t Stand alone workstation"}
1 {"`t Member workstation"}
2 {"`t Stand alone server"}
3 {"`t Member server"}
4 {"`t Back up domain controller"}
5 {"`t Primary domain controller"}
default {"`t The role can not be determined"}
}

No comments:

Node.JS rest api Tutorials