Set-SPManagedAccount

設定受管理的帳戶。

Syntax

Set-SPManagedAccount
   [-Identity] <SPManagedAccountPipeBind>
   -ConfirmPassword <SecureString>
   -NewPassword <SecureString>
   [-AssignmentCollection <SPAssignmentCollection>]
   [-Confirm]
   [-EmailNotification <Int32>]
   [-PreExpireDays <Int32>]
   [-Schedule <String>]
   [-SetNewPassword]
   [-WhatIf]
   [<CommonParameters>]
Set-SPManagedAccount
   [-Identity] <SPManagedAccountPipeBind>
   -ExistingPassword <SecureString>
   [-AssignmentCollection <SPAssignmentCollection>]
   [-Confirm]
   [-EmailNotification <Int32>]
   [-PreExpireDays <Int32>]
   [-Schedule <String>]
   [-UseExistingPassword]
   [-WhatIf]
   [<CommonParameters>]
Set-SPManagedAccount
   [-Identity] <SPManagedAccountPipeBind>
   -Password <SecureString>
   [-AssignmentCollection <SPAssignmentCollection>]
   [-Confirm]
   [-EmailNotification <Int32>]
   [-PreExpireDays <Int32>]
   [-Schedule <String>]
   [-WhatIf]
   [<CommonParameters>]
Set-SPManagedAccount
   [-Identity] <SPManagedAccountPipeBind>
   [-AssignmentCollection <SPAssignmentCollection>]
   [-AutoGeneratePassword]
   [-Confirm]
   [-EmailNotification <Int32>]
   [-PreExpireDays <Int32>]
   [-Schedule <String>]
   [-WhatIf]
   [<CommonParameters>]

Description

This cmdlet contains more than one parameter set. You may only use parameters from one parameter set and you may not combine parameters from different parameter sets. For more information about how to use parameter sets, see Cmdlet parameter sets.

Cmdlet Set-SPManagedAccount 會在指定的受管理帳戶上設定屬性。

You can use this cmdlet to change the password expiration and notification settings for the managed account: Use the default parameter set. Additionally, you can use this cmdlet to change the password for the managed account to automatically generated passwords on a set schedule: Use the parameter set that includes the AutoGeneratePassword parameter. You can also use this cmdlet to change the password for the managed account to a new value, known to the administrator: Use the parameter set that includes the SetNewPassword parameter. Finally, you can use this cmdlet to change the password for the managed account to an existing value that has been already been changed in Active Directory Domain Services (AD DS): Use the parameter set that includes the UseExistingPassword parameter.

如需適用於 SharePoint 產品的 Windows PowerShell 權限及最新資訊,請參閱線上文件 SharePoint Server Cmdlet

範例

------------------範例-----------------------

$m = Get-SPManagedAccount -Identity "DOMAINx\UserY"
Set-SPManagedAccount -Identity $m -AutoGeneratePassword true

此範例會顯示明確的受控帳戶,如果存在,然後嘗試更新它以使用自動產生的密碼。

參數

-AssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-AutoGeneratePassword

自動產生新密碼。

此類型必須是下列其中一個值:

  • True
  • False

預設值為 False。

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Confirm

在執行命令之前,提示您確認操作。 如需詳細資訊,請輸入下列命令:get-help about_commonparameters

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ConfirmPassword

確認此受管理帳戶的新密碼。

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-EmailNotification

指定在密碼變更前,提前發送電子郵件通知的天數。

預設值為 5。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ExistingPassword

將此受管理帳戶的密碼設為已在 Active Directory 網域服務 (AD DS) 中變更過之現有的值。

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Identity

指定要擷取之受管理帳戶的完整名稱或局部名稱。

此類型必須是格式為 Domain\User 的有效帳戶名稱,或格式為 1234-3456-09876 的 GUID。

Type:SPManagedAccountPipeBind
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-NewPassword

設定受管理帳戶的新密碼

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Password

設定受管理帳戶的密碼。

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-PreExpireDays

指定在密碼到期前,提前排程密碼變更的天數。

預設值為 2。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Schedule

指定要執行密碼變更工作的新排程。

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-SetNewPassword

將密碼設為傳入的新值,並變更 AD DS 中的值。

此類型必須是下列其中一個值:

  • True
  • False

預設值為 False。

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-UseExistingPassword

將密碼設為已在 AD DS 中變更過之傳入的新值。

此類型必須是下列其中一個值:

  • True
  • False

預設值為 False。

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WhatIf

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition