Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drives will be unmapped if Membership could not retrieved #44

Open
IntuneEnterPriseAdmin opened this issue Feb 18, 2023 · 0 comments
Open

Comments

@IntuneEnterPriseAdmin
Copy link

IntuneEnterPriseAdmin commented Feb 18, 2023

Hello,

if the Script runs (offline, or with no active VPN connection) the Script does not retrieve the GroupMemberships and unmapp all drives
with active GroupFilter.

$groupMemberships = Get-ADGroupMembership -UserPrincipalName $(whoami -upn)

this will return nothing

for me i changed it to

if(!$groupMemberships)
{
Write-Output "No GroupMemberships, exit Script"
exit
}

so if no GroupMemberships can be retrieved it stops the processing and does not unmapp my Drives.

ps. failure handling in this part is also important

catch {
#nothing we can do
exit
}

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant