Powershell-是否将参数还原为默认值?

Powershell-是否将参数还原为默认值?,powershell,active-directory,Powershell,Active Directory,我使用Windows Powershell的Active Directory模块运行了一个命令: Set-ADServiceAccount -Identity testAccount -PrincipalsAllowedToDelegateToAccount testGroup 实际上,我不希望testGroup成为允许删除帐户的原则 有没有办法恢复PowerShell中的内容?我想将principalsallowedelegatetoaccount设置回默认值 这在很大程度上取决于CmdL

我使用Windows Powershell的Active Directory模块运行了一个命令:

Set-ADServiceAccount -Identity testAccount -PrincipalsAllowedToDelegateToAccount testGroup 
实际上,我不希望
testGroup
成为允许删除帐户的
原则

有没有办法恢复PowerShell中的内容?我想将
principalsallowedelegatetoaccount
设置回默认值


这在很大程度上取决于CmdLet的实现。该函数来自哪个模块?@gvee它来自Windows PowershellI的Active Directory模块,这里可能很厚;但是我没有看到您在文档中提到的参数:@gvee有趣,它没有在文档中列出,但肯定在powershell帮助文档中。我用截图编辑了我的文章如果你没有先在一个变量中记录之前的值,就无法自动恢复设置更改。在进行更改之前,您是否将
Get-ADServiceAccount-Identity testAccount
的输出存储在任何位置?否则,您可以通过谷歌查看是否存在默认值并将其更改回该值(我的猜测是默认值为
$null
,但这是一个猜测)。