Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

DL group members update skip not found users in directory

$
0
0

Hi,

Below script using for DL - distribution list group updates. Script updates are quite good, however if any user not found in directory, script will skip entire DL to update further its members instead of that particular user skip. 

Foreach ($Group in(Import-csv "D:\script-users\DL\DL_30May02.csv"))

{$Members=$group.Members.split(";");update-distributiongroupmember -identity $Group.samAccountname -Members $Members -confirm:$false}

write-host "Members updates are completed"

Can any parameter to include to skip only that particular user(not found in directory) and do the DL updates properly 

Please help


MD


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>