header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
LiveAtEdu Powershell Remoting and Updating User attributes.
Last Post 20 Jun 2011 03:01 PM by Ryan. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
RyanUser is Offline
New Member
New Member
Posts:1
Avatar

--
20 Jun 2011 03:01 PM
    I have a CSV of email adddresses and Departments that I need to set on Live@edu.  The command I currently have looks something like this:

    Import-CSV departments.csv | ForEach-Object { Set-User $_.EmailAddress $_.Department }

    The problem is, this operation takes FOREVER.

    My first thought is that it would be great to have the ForEach-Object command actually be forwarded over to the remote machine, so that it will only need to create the one pipeline between the two machines, but when I go into the PSSession, there doesn't seem to be any foreach-object available.  For reference, How I Import the PSSession is:

    Import-PSSession(New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 'https://ps.outlook.com/powershell' -Credential (Get-Credential) -Authentication Basic -AllowRedirection)

    Is there a better way that I can import the session to allow ForEach-Object to be remote, or to import an aliased version of the remote foreach-object, perhaps as ForEach-Object-Remote, or perhaps does anybody have something better to suggest to streamline this process?

    Thanks, Ryan
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer