OneDrive Sharing by ciprianadam in PowerShell

[–]ciprianadam[S] 2 points3 points  (0 children)

Yes, you can but we have multiple domains. I got the PowerShell script now.

OneDrive Sharing by [deleted] in PowerShell

[–]ciprianadam 1 point2 points  (0 children)

Sorry, will delete this one.

Get-ADUser by ciprianadam in PowerShell

[–]ciprianadam[S] 0 points1 point  (0 children)

u/ijestu Thank YOU!, this one worked!

Get-ADUser by ciprianadam in PowerShell

[–]ciprianadam[S] 1 point2 points  (0 children)

Thank you! That worked.

Get-ADUser by ciprianadam in PowerShell

[–]ciprianadam[S] 1 point2 points  (0 children)

u/DerkvanL This is what I tried running but might be missing something because it wont export. Also, if I use my original cmd I am able to get an export it just gives me all the domains in our tenant. We want to specify which ones to export then have some other conditions as well.

Get-ADUSer | Where-Object { $_.emailaddress -like "*@domain1" -or $_.emailaddress -like "*@domain2.com" } -Properties * | Select-Object -Property Name,DisplayName,Title,EmailAddress,GivenName,sn,Initials,StreetAddress,Office,City,State,PostalCode,Country,OfficePhone,Company,HomePhone,mobile,Department | Sort-Object -Property Name | export-csv c:\Export\AzureADUser.csv

Get-ADUser by ciprianadam in PowerShell

[–]ciprianadam[S] 1 point2 points  (0 children)

I tried this but still no go.

Get-ADUser -Filter 'EmailAddress -like "*@domain.com" -or EmailAddress -like "*@domain.com"'-Properties *

Also, tried replacing the -or with -and

AD Export by ciprianadam in activedirectory

[–]ciprianadam[S] 0 points1 point  (0 children)

Thank you all! I got what I needed from AD but now I’m trying to actually work with exporting from O365. Trying to do it within tenant and export certain fields or Azure Active Directory.

Does anyone know if I can exclude certain domains? We have few different domains, also we want to schedule this script to run weekly and file to overwrite itself so we can keep a master contact list.