删除用户并根据组成员信息重命名homedirectory [英] delete users and rename a homedirectory based on group memberof informations
问题描述
您好,
我必须删除用户;这部分脚本已经完成。
I have to delete users; this part of script is done.
并根据广告组成员重命名同名文件夹
and rename homdirectory folder base on ad group memberof
我可以获得所有用户memberof = ok
I can get all user memberof = ok
用户是群组的成员;
使用"CN = GGFR123456,OU =例证,dc =例证= dc =例证",
groups strating with "CN=GGFR123456,OU=exemple,dc=exemple=dc=exemple"
我想在我的脚本中查询 选择正确的成员组,所以在我的情况下,上面的组。因为他们也是其他几个小组。
i want in my script to choose the correct memberof group , so in my case the group above. because they are several other groups too.
我的文件服务器名称以没有GG的同名组开头 和+ fs1 + homedir +用户名 >>
and my fileserver name start with the same name of group without GG and + fs1+homedir+username >>
\\ FR123456fs1 \homedir\username
\\FR123456fs1\homedir\username
我想获得正确的unc来根据用户 groupmembership
i want to get the correct unc to rename the user homedirectory to old_username based to the user groupmembership
解决方案将用户homedirectory重命名为old_username吗?
a solution ?
推荐答案
脚本如何知道旧的用户名是否已被删除?
how can the script know old username if the users are already deleted?
编辑:
无论您是否可以执行此类操作,
regardless of that you can do something like this,
获取组成员名称:
group = get-adgroup -filter groupname -property member
[array]
group = get-adgroup -filter groupname -property member [array]
users =""
users = ""
这篇关于删除用户并根据组成员信息重命名homedirectory的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!