Sitemap

Amicuk Programming Answers

Add users to group with file

2015-10-11   Views:5

Advertisement

So I am following power-shell script that I see online. I am trying to add 2 users (as a test for now) from a csv file into an AD group. The AD group name is "IMAllow" I created a file called AddUsersToGroup.ps1 that I am running on windows powe

So I am following power-shell script that I see online.
I am trying to add 2 users (as a test for now) from a csv file into an AD group.
The AD group name is "IMAllow"
I created a file called AddUsersToGroup.ps1 that I am running on windows power-shell.
The file contents are below
# Add User to a Group - PowerShell Script
Import-module ActiveDirectory
Import-CSV "C:\Scripts\Users.csv" | % {
Add-ADGroupMember -Identity IMAllow -Member $_.UserName
And my file with users is called "Users.csv"
wahidta
indenga
I get the following error
Add-ADGroupMember : Cannot validate argument on parameter 'Members'. The argument is null or empty. Supply an argument
that is not null or empty and then try the command again.
At C:\Users\zzwahidta\Scripts\AddUsersToGroup.ps1:7 char:44
+ Add-ADGroupMember -Identity IMAllow -Member <<<<  $_.UserName
    + CategoryInfo          : InvalidData: (:) [Add-ADGroupMember], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.ActiveDirectory.Management.Commands.AddADGrou
   pMember

The replay answer
Advertisement
Get-Help Add-ADGroupMember or http://technet.microsoft.com/en-us/library/ee617210.aspx
$creds = Get-Credential
Add-ADGroupMember -Identity IMAllow -Member $_.UserName -Credential $creds
I hope this post has helped!

Go to See the other 4 answers

Add users to group with file

Category:DefaultRelease time:2015-10-11Views:130

So I am following power-shell script that I see online. I am trying to add 2 users (as a test for now) from a csv file into an AD group. The AD group name is "IMAllow" I created a file called AddUsersToGroup.ps1 that I am running on windows powe[More]

How to add payment advice for XML file filed in vendor account group

Category:DefaultRelease time:2015-10-11Views:130

Hi All, I have a requirment to add Payment advice for XML file field in vendor account group under payment transcation tap, kindly advice where i can add above mention field in vendor account group. thanks khajadoneRead other 2 answers[More]

Can't see calander group's or add a new group in ical 5.0 (lion)

Category:DefaultRelease time:2015-10-11Views:130

Help. Can't add a new group or see my groups when i click on calander in Lion version of ical. Any idea's why? ThanksInfo taken from other discussion threads on Win not recognizing iPhone: NOT SEEN IN ITUNES: Windows 7 uses a MTP driver instead of th[More]

I have an iPad 2 with iOS 5.1 and iBooks version 2.1.1. I have 64GB of storage, 80% is used. iBooks is using 250MB of storage. I have a large number of PDF files in my iBooks library. At this time I can not add another book or PDF file to my library.

Category:DefaultRelease time:2015-10-11Views:130

I have an iPad 2 with iOS 5.1 and iBooks version 2.1.1. I have 64GB of storage, 80% is used. iBooks is using 250MB of storage. I have a large number of PDF files in my iBooks library. At this time I can not add another book or PDF file to my library.[More]

Can't add a new group

Category:DefaultRelease time:2015-10-11Views:130

When I try to add a new group as per instructions, AB fails to add that group. No error messages, nothing. It does not add the group even if I delete a few old ones. Can anyone help? BruceHmmm...I don't know....I wonder whether this could be a file p[More]

Grouping of files in the file system

Category:DefaultRelease time:2015-10-11Views:130

hi all, i am using Forms [32 Bit] Version 6.0.8.24.1 (Production). with the help of host command i am uploading any type of files from user specified location to specified directory. My requirement is like the files should be grouped wile saving to t[More]

When a group of files is selected, how can I copy just the file names?

Category:DefaultRelease time:-0001-11-30Views:130

I used to be able to select a group of files in a finder window, copy, then paste the names in an email or document. It no longer allows this. Is there away around this other than copying each file name individually?I'm also at 10.5.4, just had forgo[More]

Itunes can't add and deletes all my files

Category:DefaultRelease time:-0001-11-30Views:130

i'm trying to add some video clips to my itunes library to later use with apple tv well it crashes everytime and deletes the file or group of files i was attempting to add.See: Syncing to a "New" Computer or replacing a "crashed" Hard[More]

How to add a dba group in Unix after Installation

Category:DefaultRelease time:-0001-11-30Views:130

I need help in figuring out how to add a dba group, which one would do prior to installation, but how can one do it after installation? I need to have a group that will have people allowed to start and stop oracle. Is this possible to modify to do af[More]

Group the files based on their extensions

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I am traversing a dir and listing all the files under that directory. Now i want to group the files based on the extension and just print the number of files with each extension. ex: Extension No.of Files Size of the files .java 10 23455 bytes .h[More]

Selecting a group of files and putting them in a newly created folder?

Category:DefaultRelease time:-0001-11-30Views:130

If I select a group of files in finder or on my desktop -- is there a command to create a new folder and put them in it? (I'm thinking of how you can take a selection in iTUNES and create a playlist from the selection). (I know how to create a folder[More]

Hot
I want to upgrade my iCloud account so that I can back-up my iPhone, however I would like to pay for the upgrade using a different Apple ID than the Apple ID associated with my iCloud account. I can not figure out how to do this, when I hit buy after [More]
Have set up a new mailbox for [email protected], and want to apply the same filters as I already have in the mailbox for [email protected] Is this possible? How? Thanks!The file that stores your filter settings is called "msgFilterRules.dat". Ea [More]
I have 1 ITunes account but my IPad is synced to a Windows PC to download CDs onto my IPad and the Iphone is synced to the Mac. I was hoping that the CDs I'd put on the IPad from the Windows PC would automatically appear on my IPhone when both these [More]
I've been using PE11 for some time now. Mostly for home videos and a youtube channel. Up until this point I have used a Canon Vixia HF M-50 which was great. I had to do very little adjusting the picture in post for what I needed. But I just recieved [More]
In trying to install win xp to a VirtualBox vm, I get an error message that a boot disk can't be found. This seems logical to stupid me, as I have not yet installed the win system from the install disk. Instructions that came with the VirtualBox said [More]
Hello guys !! A cuestion, I'm doing a package with a parallel process, but this only raises 3 maximum sessions at the same time, when I hope it raises 9 how can I increase the Number of running sessions / Maximum number of sessions for the agent? Als [More]
Good morning, I am having a problem with restoring my Iphone 4s, I just get it unlock by fido and would like to restore it to factory setting but each time I am getting an error message saying the server cannot be found, how can I complete this resto [More]
Hello Experts, When we have scheduled a automated monitoring job, it is not getting executed completely and the status is shown as "In Progress". Also when we open the "Job Step Log" tab of the scheduled job in Automated Monitoring it [More]
Can't open numbers on my iPhone 5S and iPad mini (1st Gen.) after updating to the new version 2.0.1. Please help!Okay , you should only delete EMPTY DUPLICATED folders, not preview folders or any others. I would put them all back. Then just delete an [More]
I am in the process of renovating my house and want to be able to play music from my itunes library (stored on my iMac) in different rooms. I do not want to have to click play on the iMac and then move to the different room. I would like to be able t [More]