We help IT Professionals succeed at work.

Script Error

Nestor Moreno
on
259 Views
Last Modified: 2017-04-19
Hi guys, well i have a error when run script in powershell mi script is:

$msolcred = get-credential
connect-msolservice -credential $msolcred
Import-CSV D:\Documentos\PowerShell\AgregarListaDistribucion.csv | ForEach {Add-DistributionGroupMember -Identity "CAMPUS 2" -Member $_.email}

and error is:

Add-DistributionGroupMember : The term 'Add-DistributionGroupMember' is not recognized as a cmdlet, function, operable program, or script file.
+ ... rListaDistribucion.csv | ForEach {Add-DistributionGroupMember -Identi ...
+                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Add-DistributionGroupMember:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

and i dont know what happen, im newbie on powershell. Can u help me?
Thanks.
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2014
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Commented:
What snap-ins have you added to the project?

You will have to download and install these if you haven't already:

https://www.quest.com/products/active-roles/

Open in new window

Author

Commented:
Works! Thank u so much.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.