acer460527

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 98 total)
  • Author
    Posts
  • in reply to: AzureADuser foreach question #281791
    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    THanks Doug,
    an additional question that pops in my mind. A user can be member in multiple groups and this will as such also be multiple times populated in my export is there a way that I Can use distinct to just use a given user.objectid once? in the following code

    thanks again for your help

    in reply to: How to do a controlled foreach iteration #261206
    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    Thanks Doug for your reaction
    however we the 3 attempts are remaining unfortunately
    I would like to escape somehow if any of the 3 attempts was succesfull?

    Paul

    • This reply was modified 3 months, 1 week ago by acer460527.
    in reply to: Distribution groups starting with the same name #260868
    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    David,

    the Alias option did solve my problem thanks

     

    Best regards

    Paul

     

    in reply to: Distribution groups starting with the same name #260187
    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    HI David,

    thanks for your reaction,
    the error message that I get is this

     

    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    kvprasoon,
    at this moment it’s just exploring to see if this would be a solution.
    currently I have a powershell script that is taking care of the complete offboarding procedure, in order to make it work for every admin they need to install for example the azureAd module, but if there are 5 admins assigned to this region I currently would need to install it seperately for each admin which is time consuming to get it all setup.
    My goal is to install everything  in such a way on the mgmt-server that it’s being accessible for each admin on their user profile.
    that’s also the reason that I store my powershell and csv files  in the public document folder so the script will copy the required files from there to the given location under the users profile.

    Paul

     

    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    all users current host does this mean that this profile is being used by either the console or ISE or is that going to be that all users on that machine work with the same profile?

    • This reply was modified 4 months ago by acer460527.
    in reply to: starting Powershell #253673
    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    thanks all for your reactions and info

    in reply to: starting Powershell #252848
    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    Hi Grokkit,
    thanks for your reaction,

    let me explain
    I’m working for a second line helpdesk and one of the tasks is taking care of deactivating the users that are leaving the company. as such I’ve automated this through powershell so far so good. Now  people have opted to create a first line helpdesk as well and you guessed it right they have to deal with the leavers.
    I’ve created everything in such a way that you need to open 2 different ps1 files to trigger everything. but opening them in powershell ISE seems a bit tricky for my management so I opted for the cmd solution.
    or I need to make sure that the normal powershell console is started by default when executing the cmd.
    here you have the cmd that I execute to launch powershell at this point it launches the ISE and not the standard powershell console

    NOTE: I’ve removed the formatting to make sure it’s correctly presented, with using the formatting the >> and ” and > are not presented in the correct way.
    PowerShell -Command “Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted” >> “c:\temp\StartupLog.txt” 2>&1
    PowerShell C:\Users\Public\Documents\PowerShellScripts\removedistgroups.ps1 >> “c:\temp\StartupLog.txt” 2>&1

    • This reply was modified 4 months, 3 weeks ago by acer460527.
    • This reply was modified 4 months, 2 weeks ago by grokkit. Reason: code formatting
    in reply to: weird logging behaviour #248923
    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    Hi David I tried that as well but no such luck

    in reply to: powershell -SearchBase doesn’t accept OU with spaces #248761
    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    Hi
    i’ve not tested this but what you could try is

    $Ou =”3 new Students”

    and in your code

    get-aduser -Filter * -searchbase "OU=$OU,OU=Man,OU=now,DC=new,DC=go,DC=sa" -Properties * | Select-Object name,mail,Mobile,Description,EmployeeID | export"

    good Luck
    Paul

     

    • This reply was modified 5 months ago by grokkit.
    in reply to: howto restart code from the top #245919
    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    Hi Doug

    thanks for the explanation of the function Since I’m learning and a complete noob in functions I’ve got a question concerning this part

    in my original code I already import this list
    $users = import-csv c:\temp\csv\toRemove.csv

    this means that you use this list twice?
    for me it would just be sufficient to call the function again after lets say 2 min

    I did find another alternative  by modifying the Else statement by adding this code

    and in the offboarding2 I’m checking again if when the last sync is done and when the script went through that cycle to continue with removing all the groups this user was member off

    you way is obviously faster

    would this work

    thanks again for your much appreciated input

    Paul

    in reply to: reset counter #245553
    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    thanks Andy for your reaction,

    the waiting period is nothing more then waiting till the sync is done between on premises AD and AzureAD because I can only continue when the account of this given user is disabled.

    I think that from time to time the Sync is slower then the script itself which will result in the fact that the account is not updated in AzureAD in time.

    hope this helps

    in reply to: how to avoid error message being displayed #245250
    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    @rob Simmers
    thanks for the explanation

    in reply to: how to avoid error message being displayed #245090
    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    HI Olaf and Doug thanks for your reactions was not aware that you could nest 2 try blocks together

     

     

    in reply to: how to avoid error message being displayed #244925
    Participant
    Topics: 46
    Replies: 98
    Points: 633
    Rank: Major Contributor

    Hi Olaf,
    sorry I have to disagree here

    in my First test

    I know the user exists so I want to go to round 2 by using this code

    where my try block is

    or am I missing something here?

Viewing 15 posts - 1 through 15 (of 98 total)