Skip to content

Commit

Permalink
Not delete user if onPremisesImmutableId but no onPremisesSyncEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sfonteneau committed Nov 15, 2024
1 parent 9e47960 commit efaafc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AADInternals_python
4 changes: 3 additions & 1 deletion libsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ def generate_all_dict(self):
self.dict_az_user = {}
self.dict_az_group = {}

for user in self.az.list_users(select="onPremisesImmutableId,userPrincipalName"):
for user in self.az.list_users(select="onPremisesImmutableId,userPrincipalName,onPremisesSyncEnabled"):
if not user.get('onPremisesImmutableId'):
continue
if not user.get('onPremisesSyncEnabled'):
continue
self.dict_az_user[user["onPremisesImmutableId"]] = user

if not self.use_get_syncobjects:
Expand Down

0 comments on commit efaafc0

Please sign in to comment.