SarePoint Powershell Add user to Group
2013-10-18 14:27
344 查看
$FromGroupnames = "001总经理","010101管理本部" $ToGroupname = "test" $SPWeb = Get-SPWeb -Identity http://192.168.0.50:81/ $groups = $SPWeb.SiteGroups $count = 0 foreach ($group1 in $groups ) { foreach ($group2 in $FromGroupnames) { if($group1.name -eq $group2) { foreach ($user in $group1.users) { Set-SPUser $user -Web $SPWeb -Group $ToGroupname Write-Host $ToGroupname.name "adding: " $user.name; $count++ } } } } Write-Host "complete!user count ="$count
相关文章推荐
- Shell Wget
- php利用root权限执行shell脚本(二)
- linux shell基础1.2--终端打印
- Linux shell编程 9 ---- 判断+运算符
- Xshell显示中文乱码问题
- uva 10152 ShellSort
- shell 删除重复行
- linux shell 基础篇1.1
- Shell练习题(持续更新)
- 常用shell积累
- shell如何将标准错误输出重定向为标准输出
- linux shell shift
- shell脚本强制进程重启
- Linux中Shell简介
- [转载]shell sed用法与功能大全
- [挖坑系列] linux shell若干例子
- shell判断一个变量是否为空
- 37条常用Linux Shell命令组合
- Android自动化测试工具 calabash-android
- Linux shell编程 8 ---- 退出+测试