PowerShell Import-GPO:操作无效
下午大家。我遇到了一个问题,我不确定如何处理。我正在研究使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最终是我的迁移表的问题。我回到了一个早些时候,最终变得很好
Ended up being an issue with my migration table. I rolled back to an earlier one and ended up being good to go