Add Users to a Group using PowerShell Script

Script:

#Add Users to a Group - PowerShell Script

Import-module ActiveDirectory
Import-CSV "C:\Scripts\Users.csv" | % {
Add-ADGroupMember -Identity TestGroup1 -Member $_.UserName
}

原文地址:http://blog.51cto.com/549687/2120182

时间: 2024-11-08 13:12:52

Add Users to a Group using PowerShell Script的相关文章

Use powershell script against password hacking over OWA

In my previous company Exchange OWA isn't published to internet, so this blog described my first time encountering hacker trying to hack my new company's Active directory passwords. Based on it, I wrote a powershell script running on each CAS servers

Send email alert from Performance Monitor using PowerShell script (检测windows服务器的cpu 硬盘 服务等性能,发email的方法) -摘自网络

I have created an alert in Performance Monitor (Windows Server 2008 R2) that should be triggered whenever \Processor(_Total)\% Processor Time is Above 10 (a small value just to guarantee that the condition for sending the alert is always met). You ca

SharePoint2013 Powershell script to get site Title, Site Owner, Site user count and usage

Powershell script to get site Title, Site Owner, Site user count and usage Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue $wburl = Read-Host "Enter Web application URL " $webApp = Get-SPWebApplication $wburl $outputPa

PowerShell Script Analyzer, Script browser 和 Pester

昨天在MVA上看PowerShell5的最新功能的合集视频,第一个演讲人是微软PowerShell 开发组的经理,他提到了DevOp 的发展趋势,他认为对于PowerShell而言,除了基本的PowerShell的技能,还需要掌握以下基本的技能和工具: PowerShell DSC 版本控制 Git & Github 脚本最佳优化 Script Analyzer 单元测试 Pester PowerShell DSC和Github 豆子倒是用过,后面两个是什么呢? 首先看看Script Analy

Enable PowerShell script execution policy

Open     Windows PowerShell with administrator Run "Set-ExecutionPolicy     UnRestricted –Force"

利用powershell script每个月定期从microsoft download网站上抓补丁

This artical will be published in English also: http://www.cnblogs.com/LarryAtCNBlog/p/4026695.html 本人所在的公司对于安全性要求较高,除了平时各种内网加密外网firewall之外,对于server所使用的OS也要求更新到最新的security级别的补丁. 但是样本数量一多就总有些是打不上补丁的,这可能由于各种各样如update配置错误,SCCM/WSUS抽风,加上第3方扫描补丁软件的2X机制和se

Use powershell script to download windows patches monthly

My company concerns security, request us to deploy the newest patches on our servers in time, even we have firewall/encryption internally. With the number of servers increasing, there must be some servers can't be patched as expected, probably caused

Usefull Powershell script

How to get the AD compter OS Version, Created, patch Get-ADComputer -searchbase 'OU=domain controllers,DC=abc,DC=COM ' -filter * -Properties * | Select-Object Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion,created,@{n="lastLog

Powershell script for config_Win10

The line 26 SetUserAuthenticationRequired(0) Sysprep 原文地址:https://blog.51cto.com/549687/2382595