Assistance with prompting for users and then adding them to a command in PowerShell

I'm trying to create a very simple script to add members to a Distribution Group. I want to do something like I added below. I would like to prompt for user1, user2, user3, etc.. until I have no more users to add instead of manually typing out
the command below. Each time there will be a different number of users to be added. I do not want to do a csv import since it creates extra work when sometimes I only need to add 2-3 users. I find using a csv works great but takes too long when
I only have a few to add. I would like a way to just keep typing user aliases until I have no more and then hit enter and have it take my entries and enter them into the command below or some other similar command. I would like everything embedded
in the ps1 file with no other files to deal with. Any help will be appreciated. Thank you in advance. 
$DLName = Read-Host "Enter the name of the DL that members will be added to."
"user1","user2","user3" | Add-DistributionGroupMember -Identity $DLName

Here's another option:
$DLName = Read-Host 'Enter the name of the DL that members will be added to.'
((Read-Host 'Member List, separated by commas').Split(',')) | ForEach { Add-DistributionGroupMember -Identity $DLName -Member $_.Trim() }
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing)

Similar Messages

  • TS3642 It is really unacceptable that I cannot transfer my garageband format songs from iPad to iTunes for windows and then add them to my new iPad.  Any ideas?

    http://support.apple.com/kb/TS3642 tells me that this is not possible because garageband format songs are saved as folders.
    I just want to transfer songs from one iPad to another.  Why does Apple make things so hard?

    Perhaps turingtest2's fix works for you to transfer your project to iTunes for Windows, see:
          Re: Import a proyect from garage band to ipad
    But if you want to transfer between two iPads, you could use iCloud to transfer directly between the devices, if the iPads support iCloud and you are using the same Apple ID on both iPads.
    If you save the project (or better a duplicate of the project) to iCloud, you will be able to import it on the second iPad from the cloud.
    Regards
    Léonie

  • Querying for ObjectName and then sorting them

    Hi,
    I have an MBeanServer which I query using the method queryNames like this:
    QueryExp query = Query.anySubString( attValExp,strValExp);
    ObjectName scope= new ObjectName( <something> );
    Set<ObjectName> objectNames = mBeanServer.queryNames(scope, query);
    The query returns a set of ObjectNames which are, in my case, hiding objects of a type that I have created and which extends DynamicMBean.
    I want to sort these objects. The type that I wrote has a method called getId() (returns String).
    How can I sort the set that I get from the query?
    Thanks!

    When logging into the Media Store from My Verizon, the site recognizes the type of phone that you have. Having said that, it may still list applications that are not compatible with your device. The site will alert you of this game or ringtone not being compatible with your device only when you attempt to check out. 
    Thanks,

  • How can I apply a timestretch to different null objects and then use them to parent layers?

    I am using several hundred stills which are held on screen for different lengths of time. Is there a way to create null objects with various timestretch values and then use them to parent my stills?
    I'm trying to find an equivalent to the 'paste attributes' function in Final Cut Pro.
    Thanks in advance
    A

    If you have movement on the stills you can set up expressions based on in and out points. That's what I do. I then drop all my stills in order into a comp then set the out point for all stills for the longest duration. I then set group colors for layers that I want to make different lengths, do a group select and then adjust the out points for those layers. When I'm done I sequence the layers using the keyframe assistant.
    The other way I work is to use an audio track with markers for timing. I have an expression that reads the markers and sets opacity for the layers based on pairs of markers. The motion is also controlled by expressions. That's an even faster way to set up an animated slide show.
    The last way I work is just to set in an out points for all layers, sequence the layers, use expressions to do the motion and then use time remapping on a pre-comp to adjust the timing of the slide show. All methods are quick and easy.
    Here's a fly in bounce and then drop out fxx preset that will give you an idea of how expressions based on in and out point work for slide shows. You just drag the layer to it's resting position, apply the animatiokn preset and the layer flys in, bounces, and then drops out the bottom of the comp. Works in 2D and 3D space.

  • How can I monitor my monthly data usage for all 3 computers in my house? I have an Airport base station and it seems there should be software to monitor it from that point rather than monitoring the usage for each computer and then adding it up.

    How can I monitor my monthly data usage for all 3 computers in my house? I have an Airport base station and it seems there should be software to monitor it from that point rather than monitoring the usage for each computer and then adding it up.

    The following example was one of dozens that showed up on a simple Google search of.....
    monitor Internet data use on a Mac
    Watch your Internet usage with NetUse Monitor | Macworld
    Most service providers have an application for their users as well.

  • Prompt for user name and password when opening an application like Internet Explorer

    Hi
    I often use Internet Explorer using "Run as different user".  This is achieved by holding 'Shift' and right clicking the IE icon.  This is the main reason why I use IE as my default browser is Chrome.  Signing in as a different user
    is helpful when troubleshooting/customising certain applications such as Dynamics CRM.
    Is there away to force IE to always ask for credentials when I open it?  
    Marc Collins www.QGate.co.uk

    Hi GTS-NJ
    This was my first thought.  The problem I found is it requires a particular user.  I need to be flexible with the users I sign in with.
    I may have the answer though.  I have changed the security settings for trusted sites to always prompt for username and password.  I have added my sites to trusted sites.  Now when I browse to the site, it prompts me to sign in.
    Marc Collins www.QGate.co.uk

  • "catching" a prompt for user input and answering it through zenity?

    I'm trying to write a script (or multiple scripts) that will allow me to use command-line only applications via user defined actions in my file manager without having to open a terminal. Now I realize this basic functionality is already available, but as it stands I am unable to respond to command-line prompts for user input without opening a terminal. Is it possible to write a shell script that would act as a wrapper and allow me to use zenity (or another popup program) to respond to such queries?
    For example if I used a command-line program that prompted me for a password, could I "catch" that prompt with a shell script and answer it through another program, such as zenity?
    Last edited by falconheart (2011-01-16 22:37:25)

    The easier way to do this is to collect the info with zenity first, then pass it on the command line.  If the program insists on prompting, then you could try feeding it the info with redirection if it accepts it from stdin.  For example
    command < info.txt
    where info.txt is a temp file created by your script which contains whatever you want entered into the prompts.  This will work in some cases.

  • Users prompted for username and password after sharing removed from servers

    Hello Community
        On Sharepoint 2010 Server using the UI in a 2 server farm with an intranet running on it and everything functions as it should.  However it was noticed that from a users computer when in "Windows Explorer" if "Network"
    is clicked the 2 servers are visible.
        The problem is that when the server are clicked on in Windows Explorer the files and folders on the hard drive of the servers are visible too.
        Subsequently I logged onto the server and when into "Properties' - "Sharing" and
    unchecked the checkbox to "Share this folder".
        That solved the problem of the users being able to see and access the files
    and folders on servers hard drives but now when the users log onto the intranet
    they are prompted for a user name and password and even when they provide the user
    name and password and the page is returned the prompt appears on the screen again(then they cancel out).
        What can be done about the user being prompted for username and password without sharing the drives on the servers ?
        Thank you
        Shabeaut

    What exactly was shared out from the SharePoint server's file system? There are certain things that are shared by default.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • HT201328 I have been given permission for unlocking my iphone 3 GS from Orange. I want to set up the phone for my wife to use with a new number and carrier. Do I unlock under my itunes account first or set one up for her and then unlock the phone.

    I have been given permission for unlocking my iphone 3 GS from Orange. I want to set up the phone for my wife to use with a new number and carrier. Do I unlock under my itunes account first ( I now have a new iphone on this account) or set one up for her and then unlock the phone. I am worried about upsetting the new phone.

    I would complete unlocking as is and then
    restore as new once you know the iPhone is unlocked
    Be aware Orange will process the request at their speed
    one of the reasons they usually reside at bottom of User Sat surveys
    will likely take weeks
    This may also help
    http://support.apple.com/kb/HT5014

  • My MacBook Pro stated that it needed to be updated. I clicked yes to restart the computer and update but when it restarted it stays on the gray screen with the apple logo and then pops up, stating "unable to find driver for this platform." What do I do?

    My MacBook Pro stated that it needed to be updated. I clicked yes to restart the computer and update but when it restarted it stays on the gray screen with the apple logo and then pops up, stating "unable to find driver for this platform." What do I do?

    Boot into Recovery by holding down the key combination command-R at the startup chime. Release the keys when you see a gray screen with a spinning dial.
    Note: You need an always-on Ethernet or Wi-Fi connection to the Internet to use Recovery. It won’t work with USB or PPPoE modems, or with networks that require any kind of authentication other than a WPA or WPA2 Personal password.
    When the Mac OS X Utilities screen appears, follow the prompts to reinstall the Mac OS. You don't need to erase the boot volume, and you won't need your backup unless something goes wrong. If your Mac didn’t ship with Lion, you’ll need the Apple ID and password you used to upgrade, so make a note of those before you begin.
    Don't install the Thunderbolt update -- it's defective.

  • I am batch processing in PS 2014 (watermark and saving as jpeg from ps file). I get the message for some but not all 'this file needs to be saved as a copy with this option'. And then I have to save it manually. Does anyone know why this happens? (It is j

    I am batch processing in PS 2014 (watermark and saving as jpeg from ps file). I get the message for some but not all 'this file needs to be saved as a copy with this option'. And then I have to save it manually. Does anyone know why this happens? (It is just a plain photoshop file, a watermark is added, then save as jpeg - the jpeg is saved to a different folder than the original photoshop file.)  It happens for about 10 of 30/40  files approximately . Thank you, Kathryn

    I believe I have figured it out - I need to flatten the image, even though there are no layers except for layer 0, first.

  • I cannot download an app from the app store, it keeps loading until it says "You have already purchased this app so it will be downloaded no at  no additional charge", and then it prompt for password and I input it after which nothing happens.

    I cannot download an app from the app store, it keeps loading until it says "You have already purchased this app so it will be downloaded no at  no additional charge", and then it prompt for password and I input it after which nothing happens.
    I know my icloud has record of my installing this app before, but that was the first install that was failed during that time some other apps also keeps loading without respond whey they updated itself, and this app didn't install before I restart the device. But I don't see this app on my device after I restarted the device so it should have been installed on my device. It seems icloud has created some kind of dead loop that makes it not able to get the correct status about this app on my device.
    I have no problem install this app on my other device (iPad) with the same account, but just fail on my iPhone. And it just fine installing other apps...... What happened !!?? @@
    Please help !!! 

    Someone help! I dont know how to do this and please put the words into an easy way to understand because im young...

  • I previoulsy have adding many CD to my iTunes music library and then synched them with my iPhone so that I have all music in both places. And I could the CDs in iTunes or iPhone with no problems. Recently, my iTunes "sees" the music but won't play it. Why

    I have added many CD to my iTunes music library and then synched them with my iPhone so that I have all music in both places. Then I could the play them in iTunes or iPhone with no problems. Recently, my iTunes "sees" the music library but won't play any of it becuase "the original could not be found". If I attach my iPhone, then it pays them through the iPhone, but still not through the library in iTunes. How can I get the music library on my iPhone to transfer (i.e. restore it) to iTunes? I have iPhone 4S but have not upgraded to the iOS 6, and have not had any problems until last week.  Help!  Thanks.

    Check the manual for whatever backup program you used, or, if you just copied the files over, copy them that.
    How to restore data to your PC is outside the scope of these forums.

  • We use a doc template to create a purchased part spec document and then save them as pdf formatted files.  These part spec documents are also appended with the datasheets for these purchased parts.  When we want to update/revise the document, is there a m

    We use a doc template to create a purchased part spec document and then save them as pdf formatted files.  These part spec documents are also appended with the datasheets for these purchased parts.  When we want to update/revise the document, is there a method, using Acrobat, to make those updates to the pdf, or must we go back to the doc template and basically generate a new document?
    Also, our resulting pdf documents aren't searchable.  How can we generate pdf documents that are searchable?  I may want to search for a part value or name within the body of these pdf documents, but currently can't do that...very inconvenient.
    Can you assist?

    Not totally sure about the search issue. A lot depends on how you created the PDF and what is in the datasheets you attached (like are they graphics?). The doc portion should be searchable as long as you used print to the Adobe PDF printer or PDF Maker. For your use, it may be that the print is adequate. However, the result should be searchable (unless maybe you had a form with filled in fields and created the PDF with PDF Maker. I think the form data may be retained in form fields and the fields are not searchable. In that case, a print might be a better procedure. (it would help to know the versions of WORD and Acrobat as well as the exact process you used to create the PDF.)
    If the appended data sheets do not change, then you might try opening the original PDF and then using Replace Pages to replace the file created from the DOC file.

  • ADF security - prompt for user id and password again on page forward

    Hi,
    I am working with ADF using JDeveloper 10.1.3 with Business Components and ADF Faces.
    I have a Search page and a List page.
    Both pages are based on the same view within the same application module.
    The Search page is using the default Find and Execute Operations.
    The Execute button has an action that navigate to the List screen.
    faces-config.xml
    <navigation-rule>
    <from-view-id>/jspx/search.jspx</from-view-id>
    <navigation-case>
    <from-outcome>search</from-outcome>
    <to-view-id>/jspx/list.jspx</to-view-id>
    <redirect/>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/jspx/list.jspx</from-view-id>
    <navigation-case>
    <from-outcome>find</from-outcome>
    <to-view-id>/jspx/search.jspx</to-view-id>
    <redirect/>
    </navigation-case>
    </navigation-rule>
    Security (Roles and Users) is based on the jazn-data.xml and web.xml
    URL Patterns for the pages have assigned to the role.
    Login Configuration is HTTP Digest Authentication
    <web-resource-collection>
    <web-resource-name>APP_SUPPORT</web-resource-name>
    <url-pattern>faces/jspx/search.jspx</url-pattern>
    <url-pattern>faces/jspx/list.jspx</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>APP_SUPPORT</role-name>
    </auth-constraint>
    <login-config>
    <auth-method>DIGEST</auth-method>
    </login-config>
    Everything is fine when running the application from JDeveloper,
    but when the application is deployed to the server (OC4J),
    After logging into the system, the Search page prompt for user id and password again
    on click of the Execute button.
    Have anyone experience this problem before?
    Thanks for any help.
    Jim

    Hi,
    does the same thing happen if you change your protected resource from:
    <web-resource-collection>
    <web-resource-name>APP_SUPPORT</web-resource-name>
    <url-pattern>faces/jspx/search.jspx</url-pattern>
    <url-pattern>faces/jspx/list.jspx</url-pattern>
    </web-resource-collection>to:
    <web-resource-collection>
    <web-resource-name>APP_SUPPORT</web-resource-name>
    <url-pattern>/faces/jspx/*</url-pattern>
    </web-resource-collection>Brenden

Maybe you are looking for

  • Adobe Bridge CC has stopped working -again

    After many months of pain caused by Bridge CC not working it seemed to be cleared up in Sept '14. (I used just about every fix that was suggested incl. preferences changed to have no program load on startup, managing cache, etc.) I has been working f

  • Webcam error message on Satellite L300-15w and Win XP

    I have installed latest driver for webcamera (integrated) from toshiba site, and im getting error msg all the time telling me to restart camera or computer... I dont know how to restart camera... i get same msg after i restart comp... Someone know wh

  • Can't run wiki and web services at the same time?

    I'm a newbie with Lion Server, but I've been running several web sites successfully for about 6 months.  I'm up to Server 10.7.4. I've been trying ever since the first installation of Server to get the wiki service running.  I had absolutely no luck

  • Getting my music off of my ipod

    i have a mini... iTunes stopped working and had to be deleted and reinstalled.... now a good bit of my songs are on my ipod but not my itunes .... how can i get them back??

  • MediaSource error in Windows XP Tablet Edit

    Anytime you click on any song in MediaSource using a Nomad Zen Xtra 40gb player, the program crashes. This ONLY happens running MediaSource under the Windows XP Tablet Edition (SP & SP2) OS. Has anyone else experienced this and is there any way to fi