sccm - SCCM and Client 'Replace'
问题描述
GOAL: Rename all AD Objects to new convention and move them to new OU's in a restructured AD hierarchy.
I have a PS script that utilizes the SCCM site module and the Active Directory module to do the following:
- Get-CMCollectionMember
- For each Member name, Remove-CMDevice
- Move-ADObject of the same Member name
- Rename-Computer of the same Member name
- Reboot the computer
- Run SCCM TriggerSchedules for DDR and Hardware Inventory
When I run the triggerschedules, the PSComputerName shows as the computer objects OLD name. Not the new one.
Everything else seems to work - the AD object is moved, then renamed. The 'new' SCCM Device Object shows up in SCCM (via Delta System Discovery - Interval 5 min).
The problem is that SCCM (the client, I suspect) is holding on to old object info.
My question is, short of just reinstalling the client...why is this happening? I am not renaming the object in SCCM - the first step is actually removing the devices from SCCM. They are then rediscovered via Delta system discovery.
When I run...
Invoke-WMIMethod -ComputerName WD001-WK100 -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule $schedule
...at the end of the process, PSComputername is the old name.
Any advice appreciated.
解决方案
重新安装 SCCM 客户端很简单,并且可以正常工作。我只是在最后运行它而不是运行循环,因为无论如何它们都会在重新安装客户端时运行。它也解决了我的问题:
Install-CMClient -DeviceName $pc -AlwaysInstallClient $true -ForceReinstall $true
谢谢!
推荐阅读
- amazon-web-services - CloudFormation模板中如何同时使用Sub和GetAtt函数?
- sql - 如何优化视图?
- php - CakePhp 编辑表单不发送帖子数据
- symfony - 为什么 Symfony 不推荐在 php7 中加载类缓存
- ios - ios11.4升级后没有调用Locationmanager didEnterRegion
- java - 带有语言和地区的 REST API 请求
- oracle - 无法使用 Oracle SQL 开发人员导入 txt 文件
- curl - Dom 从 curl 响应中获取子节点
- c++ - 导入机器人机械臂(6 轴)的连接部件并通过用户输入使每个关节旋转(C++ 代码)
- css - 在 FlatList 中使用溢出