PowerShell Import-GPO:操作无效

发布于 2025-01-27 19:34:48 字数 769 浏览 3 评论 0原文

下午大家。我遇到了一个问题,我不确定如何处理。我正在研究使用PSREMOTING部署域控制器的脚本。一切都很好,直到到达我从备份中导入一些GPO的位置。 *所有命令均在Invoke -command下运行,

我运行命令import gpo -backupName $ gpo -targetName $ gpo -gpo -path $ gpopath $ gpopath -migrationTable $ migtable -createefnable -createifnable -createifneed

Operation is not valid due to the current state of the object.
    + CategoryInfo          : NotSpecified: (:) [Import-GPO], InvalidOperationException
    + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.GroupPolicy.Commands.ImportGpoCommand
    + PSComputerName        : v204-DC1

我似乎找不到任何说明这意味着什么的东西。当我检查DC上的GPO时,它们都出现并似乎正确地链接了。我很好奇这个错误是什么,或者如果我应该只是将-eroraction-eroration-continue附加到我的代码末尾。

Afternoon everyone. I'm running into an issue I'm not sure how to handle. I'm working on a script for work to deploy a Domain Controller using PSremoting. It all works well in fine until I get to where I'm importing some GPOs from backups.
*All the commands are run under invoke-command

I run the command Import-GPO -BackUpName $GPO -TargetName $GPO -Path $GPOPath -MigrationTable $MigTable -CreateIfNeeded

When I run this, I get an error on the host:

Operation is not valid due to the current state of the object.
    + CategoryInfo          : NotSpecified: (:) [Import-GPO], InvalidOperationException
    + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.GroupPolicy.Commands.ImportGpoCommand
    + PSComputerName        : v204-DC1

I can't seem to find anything that says what this means. When I check for the GPOs on the DC, they all show up and seem to be linked properly. I am curious what this error is, or if I should just append -ErrorAction SilentlyContinue to the end of my code.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不喜欢何必死缠烂打 2025-02-03 19:34:48

最终是我的迁移表的问题。我回到了一个早些时候,最终变得很好

Ended up being an issue with my migration table. I rolled back to an earlier one and ended up being good to go

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文