February 16, 2015 at 9:32 am #22657
We are trying to make managers aware of who has users with email on their mobile devices whether company supplied or personal.
I have a task assigned to me. I am trying to learn PowerShell, but my skills are not up to this task yet.
I have been asked to get a list of all mobile devices and their owners/users connected to Exchange 2010 through ActiveSync.
Next step is to find the managers of the Mobile Device owners/users.
Then display/write a report showing Managers and their subordinates with devices connected to ActiveSync
I would like to be able to run the script and have it email the report to the managers.
I do have script that gives me User (FirstName LastName), PrimarySMTPAddress, DeviceType,Device Model, Device OS, lastSyncAttemptTime and LastSuccessSync
I can pull the User field but cannot seem to match it to Get-ADUser data
All help would be greatly appreciated.
February 16, 2015 at 6:04 pm #22666
All you need to do is match one of the attributes from the first script to a user attribute in AD. You could modify the first script to spit out a field like "SAMAccountName" or you could use some string parsing tricks with one of the attributes you have to query the AD user. If you're still stuck it might help us to post your original script.
February 20, 2015 at 11:44 am #22792
Ok I now have a the data I need in one csv file.
Now I have to take:
and strip it down to leave Joe Bloggs
February 20, 2015 at 8:18 pm #22810
$DN = "CN=Joe Bloggs,OU=Network,OU=IT,OU=Office,OU=XXXXXX,DC=xxx,DC=yyyyyyyyyyy,DC=com" $Name = $DN.split(",") -replace "CN=","" $Name
The split method breaks the string down into bite sized chunks and puts them into an array.  selects the first chunk in the array and the -replace takes out the bits you don't want.
February 23, 2015 at 7:54 am #22820
Thanks Jack. I will play with this and see what come out.
If it works the way I want it to, I will post the script here for all to see and hopefully refine further.
You must be logged in to reply to this topic.