脚本移动用户OU,更改说明,禁用帐户并添加XXX infront fo samaccountname [英] script to move user OU, change description, disable account and add XXX infront fo samaccountname

查看:89
本文介绍了脚本移动用户OU,更改说明,禁用帐户并添加XXX infront fo samaccountname的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个脚本来移动用户OU,更改描述,禁用帐户并使用samaccountname从csv添加XXX infront fo samaccountname,但是无效。任何想法?

I'm working on a script to move user OU, change description, disable account and add XXX infront fo samaccountname from a csv with samaccountname, but is not working. Any Ideas?

import-module activedirectory
Get-Content C:\script\user.csv | Foreach {Get-ADUser $_.DN | Move-ADObject -TargetPath "OU=NewUsers,DC=user,DC=global,DC=local" -PassThru | Disable-ADAccount | Set-ADUser $_.DN -Description Termed by local IT -SamAccountName "XXX"+"SamAccountName"}

推荐答案

不工作怎么办?


这篇关于脚本移动用户OU,更改说明,禁用帐户并添加XXX infront fo samaccountname的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆