gpt4 book ai didi

powershell - set-aduser 属性与 AD 属性不同?

转载 作者:行者123 更新时间:2023-12-01 07:19:14 26 4
gpt4 key购买 nike

当我输入 help set-aduser在 PowerShell 命令行中,我获得了下面列出的信息。我有兴趣改变的属性(property)是办公室。

根据下面列出的信息,该属性指定为 -office .但是AD中没有名为office的属性,实际上是physicalDeliveryOfficeName .它们都指的是 AD 中的相同属性吗?这是为什么,我认为我可以只指定 LDAP 名称?

NAME
Set-ADUser

SYNOPSIS
Modifies an Active Directory user.

SYNTAX
Set-ADUser [-Identity] <ADUser>
[-AccountExpirationDate <System.Nullable[System.DateTime]>]
[-AccountNotDelegated <System.Nullable[bool]>] [-Add <hashtable>]
[-AllowReversiblePasswordEncryption <System.Nullable[bool]>]
[-CannotChangePassword <System.Nullable[bool]>] [-Certificates <hashtable>]
[-ChangePasswordAtLogon <System.Nullable[bool]>] [-City <string>]
[-Clear <string[]>] [-Company <string>] [-Country <string>] [-Department <string>]
[-Description <string>] [-DisplayName <string>] [-Division <string>]
[-EmailAddress <string>] [-EmployeeID <string>] [-EmployeeNumber <string>]
[-Enabled <System.Nullable[bool]>] [-Fax <string>] [-GivenName <string>]
[-HomeDirectory <string>] [-HomeDrive <string>] [-HomePage <string>]
[-HomePhone <string>] [-Initials <string>] [-LogonWorkstations <string>]
[-Manager <ADUser>] [-MobilePhone <string>] [-Office <string>]
[-OfficePhone <string>] [-Organization <string>] [-OtherName <string>]
[-PasswordNeverExpires <System.Nullable[bool]>]
[-PasswordNotRequired <System.Nullable[bool]>] [-POBox <string>]
[-PostalCode <string>] [-ProfilePath <string>]
[-Remove <hashtable>] [-Replace <hashtable>] [-SamAccountName <string>]
[-ScriptPath <string>] [-ServicePrincipalNames <hashtable>]
[-SmartcardLogonRequired <System.Nullable[bool]>] [-State <string>]
[-StreetAddress <string>] [-Surname <string>] [-Title <string>]
[-TrustedForDelegation <System.Nullable[bool]>]
[-UserPrincipalName <string>] [-AuthType {Negotiate | Basic}]
[-Credential <PSCredential>] [-Partition <string>] [-PassThru <switch>]
[-Server <string>] [-Confirm] [-WhatIf] [<CommonParameters>]

Set-ADUser -Instance <ADUser> [-SamAccountName <string>] [-AuthType {Negotiate | Basic}] [-Credential <PSCredential
>] [-Partition <string>] [-PassThru <switch>] [-Server <string>] [-Confirm] [-WhatIf] [<CommonParameters>]

最佳答案

如果您更喜欢 LDAP 名称,则可以将它们与 -Remove、-Add、-Replace 或 -Clear 参数一起使用,而不是与 LDAP 名称不同的任何常规参数。将属性和值放在一个哈希表中,多个属性用分号分隔,多个值用逗号分隔。

Set-ADUser -Identity CitizenRon -Replace @{physicalDeliveryOfficeName=Downtown;mail=citizenron@somewhere.com;telephoneNumber=888-888-8888;otherTelephone=999-999-9999,777-777-7777}

关于powershell - set-aduser 属性与 AD 属性不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21733417/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com