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
Hello All, I am new to inventory. I need some help. After opening the periods of purchasing and inventory for the month of April'15. The below reports should match in costing. But they are not matching. Kindly help on this as its PROD. Inventory Agei [More]
HI, When i am trying to apply patchesthrough SDM i am getting the following error: System: ECC 6.0 ERROR: Starting Deployment of tc/bizc/ws/ear Aborted: development component 'tc/bizc/ws/ear'/'sap.com'/'MAIN_APL70VAL_C'/'963770': Error: Caught the fo [More]
I used classic text before and this code works. var myFormat:TextFormat = dtb.getTextFormat();      while(dtb.textWidth>=dtb.width)           myFormat.size = int(myFormat.size) - 1;             dtb.setTextFormat(myFormat);           trace("best is [More]
hi I am creating a three tier CA infrastruture, I have created the 2 tiers (1 root and 2 standalone CAs), however when I try to create the issuing server (enterprise sub ordinate) I am getting the above error on the certificate request process. Basic [More]
is it possible to make photo books in iphoto and then creat a digital copy of that i ibook author as i have a great selection of books and had apple print a few, but i think it would be much nicer to have them as a digital copy on my ipadA new MBA co [More]
For example, is it fast enough to handle streaming music from mobile internet radio stations?It isn't the browser that determines the speed of the connection. That being said, every internet radio station I've ever used requires some sort of plug in, [More]
Hi All, I am trying to install MS Office 2010 SP2 32 Bit on Windows Server 2003 SP2, Standard edition. After accepting EULA, its failing with an error 'An error occurred while running detection.' I performed the installation in verbose logging mode a [More]
I have a MXL USB .007 microphone. I just got a MacBook Pro and was excited to record on it, but come to find out, the audio drivers for Leopard create static in recordings. I've looked around the forum and there doesn't seem to be one answer to this [More]
hello i need to replace ( or add one ) my superdrive that doesn't want to burn DVD-R anymore ( DVD-RW is ok ) Connecting is IDE in macpro 3.1 ( early 2008 ) . my question is : would you have a reference of a DVD superdirve that would fit/work in ? ( [More]
I wish to be able to have a choice save as to which format I want to save my document.To choose a format you can use : File > export to ...Read other 3 answers [More]