powershell 获取计算机信息

$wmi=Get-WmiObject -Class win32_computersystem 

write-host "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"}

}


你可能感兴趣的:(server,计算机,domain,default,Computer)