Set-User
Applies to: Exchange Server 2007 SP1, Exchange Server 2007 SP2, Exchange Server 2007 SP3
Use the Set-User cmdlet to modify user attributes in the Active Directory directory service.
Syntax
set-User -Identity <UserIdParameter> [-AllowUMCallsFromNonUsers <None | SearchEnabled>] [-AssistantName <String>] [-City <String>] [-Company <String>] [-Confirm [<SwitchParameter>]] [-CountryOrRegion <CountryInfo>] [-CreateDTMFMap <$true | $false>] [-Department <String>] [-DisplayName <String>] [-DomainController <Fqdn>] [-Fax <String>] [-FirstName <String>] [-HomePhone <String>] [-IgnoreDefaultScope <SwitchParameter>] [-Initials <String>] [-LastName <String>] [-Manager <UserContactIdParameter>] [-MobilePhone <String>] [-Name <String>] [-Notes <String>] [-Office <String>] [-OtherFax <MultiValuedProperty>] [-OtherHomePhone <MultiValuedProperty>] [-OtherTelephone <MultiValuedProperty>] [-Pager <String>] [-Phone <String>] [-PhoneticDisplayName <String>] [-PostalCode <String>] [-PostOfficeBox <MultiValuedProperty>] [-ResetPasswordOnNextLogon <$true | $false>] [-SamAccountName <String>] [-SimpleDisplayName <String>] [-StateOrProvince <String>] [-StreetAddress <String>] [-TelephoneAssistant <String>] [-Title <String>] [-UMDialPlan <UMDialPlanIdParameter>] [-UMDtmfMap <MultiValuedProperty>] [-UserPrincipalName <String>] [-UseRusServer <String>] [-WebPage <String>] [-WhatIf [<SwitchParameter>]] [-WindowsEmailAddress <SmtpAddress>]
set-User [-AllowUMCallsFromNonUsers <None | SearchEnabled>] [-AssistantName <String>] [-City <String>] [-Company <String>] [-Confirm [<SwitchParameter>]] [-CountryOrRegion <CountryInfo>] [-CreateDTMFMap <$true | $false>] [-Department <String>] [-DisplayName <String>] [-DomainController <Fqdn>] [-Fax <String>] [-FirstName <String>] [-HomePhone <String>] [-IgnoreDefaultScope <SwitchParameter>] [-Initials <String>] [-Instance <User>] [-LastName <String>] [-Manager <UserContactIdParameter>] [-MobilePhone <String>] [-Name <String>] [-Notes <String>] [-Office <String>] [-OtherFax <MultiValuedProperty>] [-OtherHomePhone <MultiValuedProperty>] [-OtherTelephone <MultiValuedProperty>] [-Pager <String>] [-Phone <String>] [-PhoneticDisplayName <String>] [-PostalCode <String>] [-PostOfficeBox <MultiValuedProperty>] [-ResetPasswordOnNextLogon <$true | $false>] [-SamAccountName <String>] [-SimpleDisplayName <String>] [-StateOrProvince <String>] [-StreetAddress <String>] [-TelephoneAssistant <String>] [-Title <String>] [-UMDialPlan <UMDialPlanIdParameter>] [-UMDtmfMap <MultiValuedProperty>] [-UserPrincipalName <String>] [-UseRusServer <String>] [-WebPage <String>] [-WhatIf [<SwitchParameter>]] [-WindowsEmailAddress <SmtpAddress>]
Detailed Description
The Set-User cmdlet modifies the attributes of an existing user in Active Directory.
To run the Set-User cmdlet, the account you use must be delegated the following:
Exchange Recipient Administrator role
Account Operator role for the applicable Active Directory containers
For more information about permissions, delegating roles, and the rights that are required to administer Exchange Server 2007, see Permission Considerations.
Parameters
Parameter | Required | Type | Description | ||
---|---|---|---|---|---|
Identity |
Required |
Microsoft.Exchange.Configuration.Tasks.UserIdParameter |
The Identity parameter takes one of the following values:
|
||
AllowUMCallsFromNonUsers |
Optional |
Microsoft.Exchange.Data.Directory.Recipient.AllowUMCallsFromNonUsersFlags |
This parameter specifies whether to exclude the user from directory searches. |
||
AssistantName |
Optional |
System.String |
The AssistantName parameter defines the user assistant's name. |
||
City |
Optional |
System.String |
The City parameter defines the user's city. |
||
Company |
Optional |
System.String |
The Company parameter defines the user's company. |
||
Confirm |
Optional |
System.Management.Automation.SwitchParameter |
The Confirm parameter causes the command to pause processing and requires you to acknowledge what the command will do before processing continues. You don't have to specify a value with the Confirm parameter. |
||
CountryOrRegion |
Optional |
Microsoft.Exchange.Data.Directory.CountryInfo |
The CountryOrRegion parameter defines the user's country or region. |
||
CreateDTMFMap |
Optional |
System.Boolean |
This parameter specifies that a dual tone multi-frequency (DTMF) map be created for the user. |
||
Department |
Optional |
System.String |
The Department parameter defines the user's department. |
||
DisplayName |
Optional |
System.String |
The DisplayName parameter defines the user's display name. |
||
DomainController |
Optional |
Microsoft.Exchange.Data.Fqdn |
To specify the fully qualified domain name (FQDN) of the domain controller that writes this configuration change to Active Directory, include the DomainController parameter in the command. |
||
Fax |
Optional |
System.String |
The Fax parameter defines the user's fax number. |
||
FirstName |
Optional |
System.String |
The FirstName parameter defines the user's given name. |
||
HomePhone |
Optional |
System.String |
The HomePhone parameter defines the user's home telephone number. |
||
IgnoreDefaultScope |
Optional |
System.Management.Automation.SwitchParameter |
The IgnoreDefaultScope parameter instructs the command to ignore the default recipient scope setting for the Exchange Management Shell and use the entire forest as the scope. This allows the command to access Active Directory objects that are not currently in the default scope. Using the IgnoreDefaultScope parameter introduces the following restrictions:
|
||
Initials |
Optional |
System.String |
The Initials parameter defines the user's initials. |
||
Instance |
Optional |
Microsoft.Exchange.Data.Directory.Management.User |
The Instance parameter enables you to pass an entire object to the command to be processed. It is mainly used in scripts where an entire object must be passed to the command. |
||
LastName |
Optional |
System.String |
The LastName parameter defines the user's surname. |
||
Manager |
Optional |
Microsoft.Exchange.Configuration.Tasks.UserContactIdParameter |
The Manager parameter defines the user's manager. |
||
MobilePhone |
Optional |
System.String |
The MobilePhone parameter defines the user's primary mobile phone number. |
||
Name |
Optional |
System.String |
The Name parameter defines the user's common name. |
||
Notes |
Optional |
System.String |
The Notes parameter defines additional information about the user. |
||
Office |
Optional |
System.String |
The Office parameter defines the user's physical office name or number. |
||
OtherFax |
Optional |
Microsoft.Exchange.Data.MultiValuedProperty |
The OtherFax parameter defines the user's alternative fax number. |
||
OtherHomePhone |
Optional |
Microsoft.Exchange.Data.MultiValuedProperty |
The OtherHomePhone parameter defines the user's alternative home telephone number. |
||
OtherTelephone |
Optional |
Microsoft.Exchange.Data.MultiValuedProperty |
The OtherTelephone parameter defines the user's alternative telephone number. |
||
Pager |
Optional |
System.String |
The Pager parameter defines the user's pager number. |
||
Phone |
Optional |
System.String |
The Phone parameter defines the user's office telephone number. |
||
PhoneticDisplayName |
Optional |
System.String |
The PhoneticDisplayName parameter specifies a phonetic pronunciation of the DisplayName parameter. The maximum length of this parameter value is 255 characters. For more information about the PhoneticDisplayName parameter and speech recognition, see Understanding Automatic Speech Recognition Directory Lookups. |
||
PostalCode |
Optional |
System.String |
The PostalCode parameter defines the user's zip code or postal code. |
||
PostOfficeBox |
Optional |
Microsoft.Exchange.Data.MultiValuedProperty |
The PostOfficeBox parameter defines the user's post office box number. |
||
ResetPasswordOnNextLogon |
Optional |
System.Boolean |
The ResetPasswordOnNextLogon parameter specifies whether the password specified in the Password parameter must be reset the next time the user logs on. The default value is $true. |
||
SamAccountName |
Optional |
System.String |
The SamAccountName parameter defines the logon name used to support clients and servers running older versions of the operating system, such as Microsoft Windows NT 4.0, Windows 98, Windows 95, and LAN Manager. This attribute must contain fewer than 20 characters. |
||
SimpleDisplayName |
Optional |
System.String |
The SimpleDisplayName parameter is used to display an alternative description of the object when only a limited set of characters is permitted. This limited set of characters consists of the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\"()+,-./:? |
||
StateOrProvince |
Optional |
System.String |
The StateOrProvince parameter defines the user's state or province. |
||
StreetAddress |
Optional |
System.String |
The StreetAddress parameter defines the user's physical address. |
||
TelephoneAssistant |
Optional |
System.String |
The TelephoneAssistant parameter defines the telephone number of the user's assistant. |
||
Title |
Optional |
System.String |
The Title parameter defines the user's title. |
||
UMDialPlan |
Optional |
Microsoft.Exchange.Configuration.Tasks.UMDialPlanIdParameter |
This parameter specifies the directory object ID for the dial plan. |
||
UMDtmfMap |
Optional |
Microsoft.Exchange.Data.MultiValuedProperty |
This parameter specifies if you want to create a user-defined DTMF map for the UM-enabled user. |
||
UserPrincipalName |
Optional |
System.String |
The UserPrincipalName parameter defines the user principal name (UPN) of the user. |
||
UseRusServer |
Optional |
System.String |
The UseRusServer parameter instructs the command to use the specified Mailbox server on which the Address List service is running to obtain and then set mailbox and Active Directory user attributes. The Address List service is a component in the Exchange System Attendant service. The Address List service creates and maintains Exchange-specific attribute values in Active Directory. You can use the Address List service to update recipient objects in a domain by using specific information, such as address list membership and e-mail addresses. |
||
WebPage |
Optional |
System.String |
The WebPage parameter defines the user's Web page. |
||
WhatIf |
Optional |
System.Management.Automation.SwitchParameter |
The WhatIf parameter instructs the command to simulate the actions that it would take on the object. By using the WhatIf parameter, you can view what changes would occur without having to apply any of those changes. You don't have to specify a value with the WhatIf parameter. |
||
WindowsEmailAddress |
Optional |
Microsoft.Exchange.Data.SmtpAddress |
The WindowsEmailAddress parameter specifies the e-mail address of the recipient. |
Input Types
Return Types
Errors
Error | Description |
---|---|
|
|
Exceptions
Exceptions | Description |
---|---|
|
|
Examples
Description
In the following example, the Set-User command is used to set the display name for user Ted Bremer.
Code
Set-User -Identity Contoso\Ted -DisplayName "Ted Bremer"
Description
In the following example, the Set-User command is used to remove the -manager value. To do this, you must specify $null as follows.
Code
Set-User -Identity Contoso\Ted -manager $null