variable output does not appear on 2nd loop

Home Forums Scripting PowerShell variable output does not appear on 2nd loop

Viewing 1 post (of 1 total)
  • Author

  • confuseis


    I have created a script to query user info. The whole script is to loop, purpose being to choose another user when finished.

    all variables are cleared at end of running 1st loop

    weird thing is on running the 2nd time/loop all the variables bar 1 show their data/contents.

    only below is displayed the 1st run but not the 2nd !
    $useraddetails | select,name,samaccountname

    instead i get {} {} or a blank space.

    Any idea why this could be ?

    for testing on the 2nd Ioop. I did break the script near the end (before it had a chance to clear the variables) and ran $useraddetails | select,name,samaccountname
    and it outputted the correct user from the powershell CLI just fine. so why not then from the script !?



Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

External Sharing and Guest User Access in Microsoft 365 and Teams

This eBook will dive into policy considerations you need to make when creating and managing guest user access to your Teams network, as well as the different layers of guest access and the common challenges that accompany a more complicated Microsoft 365 infrastructure.

You will learn:

  • Who should be allowed to be invited as a guest?
  • What type of guests should be able to access files in SharePoint and OneDrive?
  • How should guests be offboarded?
  • How should you determine who has access to sensitive information in your environment?

Sponsored by: