Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Active directory 使用新ADUser时设置ProtectedFromAccidentalDelete参数_Active Directory_Powershell 3.0 - Fatal编程技术网

Active directory 使用新ADUser时设置ProtectedFromAccidentalDelete参数

Active directory 使用新ADUser时设置ProtectedFromAccidentalDelete参数,active-directory,powershell-3.0,Active Directory,Powershell 3.0,在使用New ADUsercmdlet时,是否可以设置-protectedfromcidentialdelement参数,还是必须在之后使用设置对象 我可以将此设置为“用户”的默认设置吗 这是执行man New ADUser时可用的参数列表 New-ADUser [-Name] <string> [-WhatIf] [-Confirm] [-AccountExpirationDate <datetime>] [-AccountNotDelegated <bool&g

在使用
New ADUser
cmdlet时,是否可以设置
-protectedfromcidentialdelement
参数,还是必须在之后使用
设置对象

我可以将此设置为“用户”的默认设置吗

这是执行man New ADUser时可用的参数列表

New-ADUser
[-Name] <string>
[-WhatIf] [-Confirm]
[-AccountExpirationDate <datetime>]
[-AccountNotDelegated <bool>]
[-AccountPassword <securestring>]
[-AllowReversiblePasswordEncryption <bool>]
[-AuthType <ADAuthType> {Negotiate | Basic}]
[-CannotChangePassword <bool>]
[-Certificates <X509Certificate[]>]
[-ChangePasswordAtLogon <bool>]
[-City <string>]
[-Company <string>]
[-CompoundIdentitySupported <bool>]
[-Country <string>]
[-Credential <pscredential>]
[-Department <string>]
[-Description <string>]
[-DisplayName <string>]
[-Division <string>]
[-EmailAddress <string>]
[-EmployeeID <string>]
[-EmployeeNumber <string>]
[-Enabled <bool>]
[-Fax <string>]
[-GivenName <string>]
[-HomeDirectory <string>]
[-HomeDrive <string>]
[-HomePage <string>]
[-HomePhone <string>]
[-Initials <string>]
[-Instance <ADUser>]
[-KerberosEncryptionType <ADKerberosEncryptionType> {None | DES | RC4 | AES128 | AES256}]
[-LogonWorkstations <string>]
[-Manager <ADUser>]
[-MobilePhone <string>]
[-Office <string>]
[-OfficePhone <string>]
[-Organization <string>]
[-OtherAttributes <hashtable>]
[-OtherName <string>]
[-PassThru]
[-PasswordNeverExpires <bool>]
[-PasswordNotRequired <bool>]
[-Path <string>]
[-POBox <string>]
[-PostalCode <string>]
[-PrincipalsAllowedToDelegateToAccount <ADPrincipal[]>]
[-ProfilePath <string>]
[-SamAccountName <string>]
[-ScriptPath <string>]
[-Server <string>]
[-ServicePrincipalNames <string[]>]
[-SmartcardLogonRequired <bool>]
[-State <string>]
[-StreetAddress <string>]
[-Surname <string>]
[-Title <string>]
[-TrustedForDelegation <bool>]
[-Type <string>]
[-UserPrincipalName <string>]
[<CommonParameters>]
newaduser
[-姓名]
[-WhatIf][-确认]
[-账户到期日]
[-账户未授权]
[-AccountPassword]
[-AllowVersionPasswordEncryption]
[-AuthType{Negotiate | Basic}]
[-不能更改密码]
[-证书]
[-ChangePasswordAtLogon]
[-城市]
[-公司]
[-CompoundIdentitySupported]
[-国家]
[-凭证]
[-部门]
[-说明]
[-DisplayName]
[-分部]
[-电邮地址]
[-EmployeeID]
[-员工编号]
[-启用]
[-传真]
[-givename]
[-homeditory]
[-HomeDrive]
[-主页]
[-家庭电话]
[-首字母]
[-实例]
[-KerberosEncryptionType{None | DES | RC4 | AES128 | AES256}]
[-登录工作站]
[-经理]
[-手机]
[-办公室]
[-OfficePhone]
[-组织]
[-其他属性]
[-其他名称]
[-PassThru]
[-PasswordNeverExpires]
[-PasswordNotRequired]
[-Path]
[-POBox]
[-邮政编码]
[-原则允许删除帐户]
[-ProfilePath]
[-SamAccountName]
[-ScriptPath]
[-服务器]
[-ServicePrincipalNames]
[-需要智能卡登录]
[-国家]
[-街道地址]
[-姓氏]
[-标题]
[-委托删除]
[-类型]
[-UserPrincipalName]
[]

我不认为在使用
新ADUser
时可以指定该参数,但是在使用
新ADObject
命令创建帐户时,可以使用
-protectedfromcidentaldeltion$true
。请参见以下TechNet中的示例:

New-ADObject -name SaraDavisContact -type contact -ProtectedFromAccidentalDeletion $true -OtherAttributes @{'msDS-SourceObjectDN'="CN=FabrikamContacts,DC=CONTOSO,DC=COM"}
在上面的示例中,正在创建一个联系人,但是您可以简单地更改逻辑以实现所需的结果

有关更多信息,请参阅本文:

注意:请注意,新的ADObject命令是一个更强大的commandlet。