I need to take an input file that has emails of users format like this of course victor.laskoskie@nomail.com
the query using dsquery or powershell AD to get the following and export or import to an excel spreadsheet.
meaning
Create a PS script to read it , pick up from AD the Full Name / EmpID and Active/Disabled status for the output file with the email.
is this possible?
Indeed, it is possible...
1. group all your email addresses into a file, eg. emailadd.txt
Email
victor.laskoskie@noemail.com
power.shell@noemail.com
2. create this PowerShell script, eg. myPSscript.ps1
$cont = import-csv C:\emailadd.txtforeach ($rec in $cont)
{$i1 = $rec.Email.split(".,@")$fname = $i1[0]$lname = $i1[1]dsquery .....}
You can test the output by substituting the dsquery line with "write-output $fname $lname"
There may be better methods of doing this, but this is my version.
--samuel
Glad to assist...
I would suggest that you invest some time in downloading and installing the free ActiveRoles Management Shell for Active Directory from Quest - http://www.quest.com/powershell/activeroles-server.aspx
The CMDLets contained herin, will provide much quicker access to information that you require from AD. I use it and it is great fun!
For Example;
ActiveRoles provide a get-QADuser cmdlet that can be used to solve your problem -
get-qaduser -Firstname $fname -LastName $lname | select-property Disabled
If the test returns true, then you can output all the parameters that were declared out to a file to produce your report.
Let me know if you need any further assistance.