+ Post New Thread
Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 57
Cloud Services Thread, Office 365 questions in Technical; I could have done it by hand 3 times over by now... So that what I'll do...
  1. #31
    chazzy2501's Avatar
    Join Date
    Jan 2008
    Location
    South West
    Posts
    1,800
    Thank Post
    215
    Thanked 264 Times in 214 Posts
    Rep Power
    67
    I could have done it by hand 3 times over by now... So that what I'll do

  2. #32
    chazzy2501's Avatar
    Join Date
    Jan 2008
    Location
    South West
    Posts
    1,800
    Thank Post
    215
    Thanked 264 Times in 214 Posts
    Rep Power
    67
    @sonofsanta I can't get this to work? it just outputs "type 1 for students or staff" every other line of the script?

  3. #33

    sonofsanta's Avatar
    Join Date
    Dec 2009
    Location
    Lincolnshire, UK
    Posts
    4,995
    Thank Post
    867
    Thanked 1,452 Times in 999 Posts
    Blog Entries
    47
    Rep Power
    642
    Quote Originally Posted by chazzy2501 View Post
    @sonofsanta I can't get this to work? it just outputs "type 1 for students or staff" every other line of the script?
    Should only do that if you're giving it something other than 1 or 2 for the answer, as per the while loop. Try adding
    Code:
    Write-Host "userType was " $userType -f red
    in the while loop, after the Read-Host line, see if it's outputting what you input.

  4. #34
    chazzy2501's Avatar
    Join Date
    Jan 2008
    Location
    South West
    Posts
    1,800
    Thank Post
    215
    Thanked 264 Times in 214 Posts
    Rep Power
    67
    I'm copying your script and right clicking and pasting into the ps window. is their another way?

  5. #35
    chazzy2501's Avatar
    Join Date
    Jan 2008
    Location
    South West
    Posts
    1,800
    Thank Post
    215
    Thanked 264 Times in 214 Posts
    Rep Power
    67
    hummm, spotted an error with my csv and re did it... it's zipping away with yellow green and mostly red stuff



    EDIT:

    it's stopped not complete:

    Code:
    The term 'Set-MsolUserLicense' is not recognized as the name of a cmdlet, funct
    ion, script file, or operable program. Check the spelling of the name, or if a
    path was included, verify that the path is correct and try again.
    At line:8 char:28
    +         Set-MsolUserLicense <<<<  -UserPrincipalName $_.EmailAddress -AddLice
    nses
        + CategoryInfo          : ObjectNotFound: (Set-MsolUserLicense:String) [],
        CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    
    BeaminsterSch:OFFICESUBSCRIPTION_STUDENT
    pupilnamehidden@beaminster.dorset.sch.uk granted Office licence
    looking at the last user it says licence granted but it hasn't.
    Last edited by chazzy2501; 20th March 2014 at 04:34 PM.

  6. #36

    sonofsanta's Avatar
    Join Date
    Dec 2009
    Location
    Lincolnshire, UK
    Posts
    4,995
    Thank Post
    867
    Thanked 1,452 Times in 999 Posts
    Blog Entries
    47
    Rep Power
    642
    Save it into a blank text document, save it with a .ps1 extension, then open PowerShell, cd to the correct directory and run it with .\scriptName.ps1 - easiest way of running it (whilst being able to edit it).

    Not sure why it's complaining about Set-MsolUserLicense not being recognized - it bloomin' well is a command. Have you installed the Windows Azure Active Directory Module for Windows Powershell?

  7. #37
    chazzy2501's Avatar
    Join Date
    Jan 2008
    Location
    South West
    Posts
    1,800
    Thank Post
    215
    Thanked 264 Times in 214 Posts
    Rep Power
    67
    I consider myself moderately intelligent and all I have to do is modify a script! 3 hours of pi55ing around has gotten me bu33er all. Now is it possible that I have an old or wrong version of something? because I'm pasting in commands and something won't work. (named parameter not found and invalid arguments)


    Could someone write a script for me "a2 plan students" & "office pro plus" for all my pupils in the department "pupil" and set them to GB location just in case. This may need to override existing licensing options and they may or may not be licenced. my sdku thingy is "BeaminsterSch"

    I'm updating my server tonight in case I'm missing a patch>?

  8. #38

    EduTech's Avatar
    Join Date
    Aug 2007
    Location
    Reading
    Posts
    5,068
    Thank Post
    160
    Thanked 925 Times in 727 Posts
    Blog Entries
    3
    Rep Power
    273
    Hi,

    If you are finding that the above cmdlets are not available for you to use, then this is most likely because you have an out-dated version of the Windows Azure Active Directory PowerShell Module. I would advise you to review the following article: Manage Windows Azure AD using Windows PowerShell

    Download the latest version of the PowerShell module based on the architecture of your device.

    If you need any further help let me know.

    James.

  9. #39
    chazzy2501's Avatar
    Join Date
    Jan 2008
    Location
    South West
    Posts
    1,800
    Thank Post
    215
    Thanked 264 Times in 214 Posts
    Rep Power
    67
    That is the exact link where I installed the module this morning. (the link was purple :0)

    I've just spotted the run as admin in the startup (I've been using the desktop shortcut) most things although not working are now not complaining of unknown cmdlts!

    This Fing sucks... Hours wasted because of a useless need to run as admin...

    starting over..
    .

  10. #40
    chazzy2501's Avatar
    Join Date
    Jan 2008
    Location
    South West
    Posts
    1,800
    Thank Post
    215
    Thanked 264 Times in 214 Posts
    Rep Power
    67
    That is the exact link where I installed the module this morning. (the link was purple :0)

    I've just spotted the run as admin in the startup (I've been using the desktop shortcut) most things although not working are now not complaining of unknown cmdlts!

    This Fing sucks... Hours wasted because of a useless need to run as admin...

    starting over..
    .

  11. #41

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,049
    Thank Post
    888
    Thanked 1,728 Times in 1,491 Posts
    Blog Entries
    12
    Rep Power
    453
    Quote Originally Posted by Edu-IT View Post
    I've just been reading up, and apparently the data centre is decided when you sign up, not because of this command?
    Got a link somewhere that says different. Apparently its like that for companies who are global so they can use the data center closest to the user.

    Checked the link, its dead, must be duff information!
    Last edited by FN-GM; 20th March 2014 at 06:12 PM.

  12. #42

    EduTech's Avatar
    Join Date
    Aug 2007
    Location
    Reading
    Posts
    5,068
    Thank Post
    160
    Thanked 925 Times in 727 Posts
    Blog Entries
    3
    Rep Power
    273
    Quote Originally Posted by chazzy2501 View Post
    That is the exact link where I installed the module this morning. (the link was purple :0)

    I've just spotted the run as admin in the startup (I've been using the desktop shortcut) most things although not working are now not complaining of unknown cmdlts!

    This Fing sucks... Hours wasted because of a useless need to run as admin...

    starting over..
    .
    The symptoms your have been explaining would be caused if you are using an out of date module or if the module hasn't been imported into the powershell session. so please be mindful this is the case before running such commands.

    It's not hours wasted :-) it's all good learning!

    James.

  13. #43

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,157
    Thank Post
    403
    Thanked 623 Times in 569 Posts
    Rep Power
    181
    While we're talking Powershell. Does anyone know how I can bulk add a an SMTP address to each user that is the same as the first part of their current SMTP address, but with a different latter part? For example jbloggs@google.com is their current one, but I want to add jbloggs@google.co.uk and set that as their primary. And do the same for each user.

  14. #44

    sonofsanta's Avatar
    Join Date
    Dec 2009
    Location
    Lincolnshire, UK
    Posts
    4,995
    Thank Post
    867
    Thanked 1,452 Times in 999 Posts
    Blog Entries
    47
    Rep Power
    642
    Quote Originally Posted by Edu-IT View Post
    While we're talking Powershell. Does anyone know how I can bulk add a an SMTP address to each user that is the same as the first part of their current SMTP address, but with a different latter part? For example jbloggs@google.com is their current one, but I want to add jbloggs@google.co.uk and set that as their primary. And do the same for each user.
    In an Active Directory powershell window (not Azure, local AD), based on looping through a CSV called changeEmail.csv saved in the same folder as this .ps1 script with the header EmailAddress and Username:
    Code:
    Import-Csv .\changeEmail.csv | foreach-object {
    	$coUkEmail = $_.EmailAddress.Replace("google.com", "google.co.uk")
    	Set-ADUser -Identity $_.Username -EmailAddress $coUkEmail
    	Get-ADUser $Username | Set-ADUser -Add @{proxyAddresses=$EmailAddress} -PassThru
    	Write-Host "`n============================================`n" -ForegroundColor Green
    }
    That uses Replace to create the new email based on the old, sets the primary address to the new, and adds the old as a proxy address (which is what Office 365 uses for alternate addresses - don't know about Google apps if that's what you're using).

    Not actually tested that as it's based on combining & stripping down parts from two scripts, one used to add the @ tenancy.onmicrosoft.com address as well as an @ school.org address, the other for renaming a user and keeping all their old addresses.

    You should be able to create the CSV using PowerShell to dump AD details into a file, though it might take some tidying up. And yes, I do use CSVs for all my PowerShell, because I am a one trick pony and can't work out the better ways of doing it if you wanted to do it all at once there should be a way of just moving through all the AD objects in a particular tree - someone smarter may be able to tell you.
    Last edited by sonofsanta; 21st March 2014 at 09:32 AM.

  15. #45
    Boredguy's Avatar
    Join Date
    Jun 2011
    Location
    Swindon
    Posts
    594
    Thank Post
    4
    Thanked 133 Times in 124 Posts
    Rep Power
    50
    You can do it easily without scripting via the AD Users and Computer interface

    Select your users -> Properties
    Tick the e-mail box then enter the value %username%@google.co.uk
    Hit Ok and it's done

    Note: it will replace the old one, otherwise you will need to PS it to use the proxyAddress for aliases
    Last edited by Boredguy; 21st March 2014 at 11:22 AM.

SHARE:
+ Post New Thread
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Office 365 questions / advice needed
    By tj2419 in forum Cloud Services
    Replies: 1
    Last Post: 1st November 2012, 04:40 PM
  2. Office 365 Question
    By FN-GM in forum Cloud Services
    Replies: 8
    Last Post: 4th June 2012, 04:43 PM
  3. General Office 365 Questions, Help please!
    By AndyCan in forum Cloud Services
    Replies: 0
    Last Post: 22nd May 2012, 05:14 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •