标签:
下面两个实例可以看出:
Get-ADGroupMember -Identity "CN=gAPCHN-HGZ-IE10-Users,OU=Groups,OU=Hangzhou - China,OU=TCS - China,OU=TCS - China,DC=apac,DC=TCS,DC=com" | select -Property SamAccountName | ForEach-Object {
Get-ADUser -Identity $PSItem.SamAccountName -Properties * | select DisplayName
}
$SANs = Get-ADGroupMember -Identity "CN=gAPCHN-HGZ-IE10-Users,OU=Groups,OU=Hangzhou - China,OU=TCS - China,OU=TCS - China,DC=apac,DC=TCS,DC=com" | select -Property SamAccountName
Foreach ($PSItem in $SANs) {
Get-ADUser -Identity $PSItem.SamAccountName -Properties * | select DisplayName
}
Foreach 与 Foreach-Object 的区别
标签:
原文地址:http://www.cnblogs.com/IvanChen/p/4488537.html