微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用Powershell更新Active Directory中的Active Directory用户属性

在使用Powershell v2.0的Windows Server 2003 R2环境中,如何复制Set-QADUser的function以更新Active Directory中的用户属性(如电话号码和标题)?

这里的技巧是,我想这样做,而不依赖于Set-QADUser,我没有select使用Server 2008的commandlets。

谢谢。

单点login/ Windows身份validation入门

在工作组机器上testingWindows AD集成

base64_encode()中的差异

活动目录和linux nslcd绑定,而不扩展AD模式

Hyper-V将虚拟机join到托pipe在另一个虚拟机中的域

将button添加到Windows 7login屏幕

如果在Windows上作为服务运行,则认凭证目录条目将绑定到哪个认凭证

如何确定login的Windows帐户是否已在域上进行身份validation

使用logonUser()仅用于validation凭证

Windows用户域帐户问题

从互联网上把东西拼凑起来,我想出了这个…

function Get-ADUser( [string]$samid=$env:username){ $searcher=New-Object DirectoryServices.DirectorySearcher $searcher.Filter="(&(objectcategory=person)(objectclass=user)(sAMAccountname=$samid))" $user=$searcher.FindOne() if ($user -ne $null ){ $user.getdirectoryentry() } } $user = Get-ADUser 'UserName' # Output all properties $user.psbase.properties # Change some properties $user.title = 'New Title' $user.telephoneNumber = '5555551212' $user.SetInfo() # Output the results $user.title $user.telephoneNumber

更多信息

使用PowerShell与ADSI一起管理Active Directory环境

SelfADSI:ADSI脚本教程/ LDAP脚本教程

IADsUser接口

您将需要在PowerShell中使用ADSI对象 。 语法将看起来类似于VBScript,因为您使用的是相同的组件。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐