本文介绍了dsmod或其他命令来编辑AD用户属性(街道,邮政信箱,城市,州,邮政编码)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DSMOD似乎没有能力更新用户广告属性的这一部分(街道,邮政信箱,城市,州,邮编)。



动机:
我想用特定的用户信息填充整个名单吗?



动机:
。我还将包括电话号码和业务信息(标题,公司,部门)。



我有一个包含所有这些信息的花名册电子表格,我想撰写该命令会将名单中的每个用户的所有这些信息推送到AD。



但是,我似乎找不到能使我更新用户属性地址标签下的信息的命令(如果从AD用户和计算机)。



希望有人知道更好的方法!

解决方案

Set-ADUser可以完成我一直在寻找的一切,它或多或少是内置的。



这是一个Active Directory域服务Cmdlet,必须首先启用在Windows / PowerShell中。请参阅此处的安装/配置说明:



在此处查看使用说明:



以下是它可以推送的某些字段(在许多其他设置中) :

  [-城市< String>] 
[-公司< String>]
[ -国家< String>]
[-部门< String>]
[-描述< String>]
[-DisplayName< String>]
[-部门< String>]
[-EmailAddress< Stri ng>]
[-EmployeeID< String>]
[-EmployeeNumber< String>]
[-Fax< String>]
[-GivenName< String> ]
[-HomeDirectory< String>]
[-HomeDrive< String>]
[-HomePage< String>]
[-HomePhone< String>]
[-Initials< String>]
[-Manager< ADUser>]
[-MobilePhone< String>]
[-Office< String>]
[-OfficePhone< String>]
[-Organization< String>]
[-OtherName< String>]
[-POBox< String>]
[ -PostalCode< String>]
[-ProfilePath< String>]
[-ScriptPath< String>]
[-Server< String>]
[-State < String>]
[-StreetAddress< String>]
[-姓氏< String>]
[-标题< String>]

它甚至可以像带有实例参数的对象一样使用,就像上一个答复所建议的那样:

  C:\PS> $ user = Get-ADUser GlenJohn-属性邮件,部门
$ user.mail = [email protected]
$ user.department =帐户
Set-ADUser -instance $ user

应该易于构建脚本。太酷了!


It does not appear that DSMOD has the capability to update this portion of a user's AD attributes (Street, P.O. Box, City, State, Zip). Are there any command line alternatives out there I can run from powershell or cmd?

Motivation:I'm trying to populate our entire roster with specific user info. I will also include phone numbers, and business information (title, company, department).

I have a roster spreadsheet with all this information, and I'd like to compose a command that will push all this info to AD for every user in the roster.

However, I cannot seem to find a command that will allow me to update the information found under the "Address" tab on the user attributes (if looking up the user from AD Users & Computers).

Hopefully someone knows of a better way!

解决方案

Set-ADUser does everything I was looking for and it's more or less built in.

It is an Active Directory Domain Services Cmdlet that must be enabled first in windows/powershell. See install/config instructions here: http://blogs.technet.com/b/heyscriptingguy/archive/2010/01/25/hey-scripting-guy-january-25-2010.aspx

See usage instructions here:http://blogs.technet.com/b/heyscriptingguy/archive/2012/10/31/use-powershell-to-modify-existing-user-accounts-in-active-directory.aspx

Here are some of the fields it's capable of pushing (among many other settings):

[-City <String>]
[-Company <String>]
[-Country <String>]
[-Department <String>]
[-Description <String>]
[-DisplayName <String>]
[-Division <String>]
[-EmailAddress <String>]
[-EmployeeID <String>]
[-EmployeeNumber <String>]
[-Fax <String>]
[-GivenName <String>]
[-HomeDirectory <String>]
[-HomeDrive <String>]
[-HomePage <String>]
[-HomePhone <String>]
[-Initials <String>]
[-Manager <ADUser>]
[-MobilePhone <String>]
[-Office <String>]
[-OfficePhone <String>]
[-Organization <String>]
[-OtherName <String>]
[-POBox <String>]
[-PostalCode <String>]
[-ProfilePath <String>]
[-ScriptPath <String>]
[-Server <String>]
[-State <String>]
[-StreetAddress <String>]
[-Surname <String>]
[-Title <String>]

It can even be used like an object with instance parameters like the previous reply was suggesting:

C:\PS>$user = Get-ADUser GlenJohn -Properties mail,department
$user.mail = "[email protected]"
$user.department = "Accounting"
Set-ADUser -instance $user

Should make it easy to build scripts around. Very cool!

这篇关于dsmod或其他命令来编辑AD用户属性(街道,邮政信箱,城市,州,邮政编码)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 16:12