标签:users min res tor new ike 查看 ini mem
工作当中需要查看本地组成员信息,从网上看到使用net localgroup 命令可以实现本地组成员信息,经过再加工得到如下信息,备忘至此!$localgroups = "Administrators","Remote Desktop Users"
$result = @()
foreach($group in $localgroups){
$groupmembers = net localgroup $group
foreach($member in $groupmembers){
if($member -like "CONTOSO*" -and $member -ne "CONTOSO\Domain Admins"){
$psobject = New-Object psobject
$psobject | Add-Member -MemberType NoteProperty -Name GroupName -Value $group
$psobject | Add-Member -MemberType NoteProperty -Name Members -Value $member
$result+=$psobject
}
}
}
$result
标签:users min res tor new ike 查看 ini mem
原文地址:https://blog.51cto.com/11333879/2418766