| Author |
Topic  |
|
|
Pesos
Honorable But Hopeless Addict
    
USA
3506 Posts
Status: offline |
Posted - 06/29/2012 : 2:35:47 PM
|
|
Anyone know of a tool/method to create a roster that lists staff/titles/contact info/photo etc and can be dynamically generated from AD?
|
-Wes |
|
|
hairtrigger
Seasoned But Casual Onlooker

USA
30 Posts
Status: offline |
Posted - 06/29/2012 : 6:49:30 PM
|
Using the Quest powershell commandlets you could do something like: Get-QADUser | select DisplayName, Title, Phone, mail | Export-CSV c:\temp\user.csv |
-Nate "If you have to do it more than once.. script it" |
 |
|
|
Pieter
Old Timer
  
Belgium
522 Posts
Status: offline |
Posted - 07/03/2012 : 03:25:14 AM
|
Or use dsquery.exe:
dsquery * -filter (objectcategory=user) -limit 0 -attr sAMAccountName title TelephoneNumber proxyAddresses
or
dsquery * -filter (objectcategory=user) -limit 0 -l -attr sAMAccountName title TelephoneNumber proxyAddresses ......................... to have it in a list (with dotted line as a separator)
Tip: start with the option "-l 5" to limit the output to only 5 accounts.
|
Pieter Demeulemeester |
 |
|
|
Pieter
Old Timer
  
Belgium
522 Posts
Status: offline |
|
|
Jazzy
Administrator
    
Netherlands
1932 Posts
Status: offline |
Posted - 07/03/2012 : 03:34:07 AM
|
If you're running anything higher than Server 2003 I'd recommend the native AD PowerShell cmdlets.
Import-Module ActiveDirectory Get-ADUser -Filter * | select Displayname,Title | Export-CSV c:\temp\user.csv
On Server 2012 you don't need to import the module, it's automatically loaded when you start PowerShell. |
Jetze Mellema
Exchange specialist Former MVP (2005-2012) My blog: http://jetzemellema.blogspot.com (Dutch) My company: http://www.imara-ict.nl/ |
 |
|
|
Xenophane
Honorable But Hopeless Addict
    
Denmark
3070 Posts
Status: offline |
Posted - 07/03/2012 : 05:01:03 AM
|
You can export the picture like this:
(Get-QADUser <Username> -IncludeAllProperties).DirectoryEntry.thumbnailPhoto | Set-Content c:\Temp\<Username>.jpg -Encoding byte
Sorry Jetze I still have not been able to get myself to use the Microsoft AD cmdlets |
Microsoft Powershell MVP
SIG> George Bernard Shaw : The power of accurate observation is commonly called cynicism by those who have not got it. </SIG>
You can read my blog at www.xipher.dk |
 |
|
|
Jazzy
Administrator
    
Netherlands
1932 Posts
Status: offline |
Posted - 07/03/2012 : 05:24:40 AM
|
quote: Originally posted by Xenophane
Sorry Jetze I still have not been able to get myself to use the Microsoft AD cmdlets
They're not necessary better than the Quest ones but they're native and do not require the user to install software on the servers. Besides that, both options have their advantages but have generally equal capabilities. |
Jetze Mellema
Exchange specialist Former MVP (2005-2012) My blog: http://jetzemellema.blogspot.com (Dutch) My company: http://www.imara-ict.nl/ |
 |
|
|
Xenophane
Honorable But Hopeless Addict
    
Denmark
3070 Posts
Status: offline |
Posted - 07/03/2012 : 05:34:52 AM
|
Jetze I never install the Quest tools on the servers, I install them on my management computer :) (But that is completely off topic)
I had a few minutes left of my lunch break, so I hacked together a simple script will create it a list for a single user, can easily be extended (Cleaned up).
Function Create-HTML {
Param ($username)
(Get-QADUser $username).DirectoryEntry.thumbnailPhoto | Set-Content c:\Temp\$($username).jpg -Encoding byte
Get-QADUser $username |
Select-Object -Property @{n='Full Name';e={$_.Name}},
@{n='E-Mail';e={$_.EMail}},
@{n='Mobile Phone';e={$_.MobilePhone}} |
ConvertTo-HTML -Fragment -As LIST -PreContent "<img src='$($username).jpg' alt='$username' /> <h2>$userName</h2>" | Out-String
}
Create-HTML -username ctn | Out-File c:\Temp\ctn.html
|
Microsoft Powershell MVP
SIG> George Bernard Shaw : The power of accurate observation is commonly called cynicism by those who have not got it. </SIG>
You can read my blog at www.xipher.dk |
 |
|
|
Xenophane
Honorable But Hopeless Addict
    
Denmark
3070 Posts
Status: offline |
Posted - 07/04/2012 : 08:11:56 AM
|
Added a little HTML during my lunch break (Don't run this through a HTML checker, it might throw up at you)
If it does not find an image in AD, it defaults to putting in the filename Silhoutte.jpg, so you have to place a file called that in the $path
$HTMLBegin = @"
<html>
<head>
<title>My Company Facebook</title>
<style type="text/css">
table.curvedEdges { border:10px solid #98FB98;-webkit-border-radius:13px;-moz-border-radius:13px;border-radius:13px; }
table.curvedEdges td, table.curvedEdges th { border-bottom:1px dotted black;padding:5px; }
</style>
</head>
<body>
<p style="text-align:Center;"><h1>Company Facebook</h1></p>
<table class="curvedEdges">
"@
$HTMLEnd = @"
</table>
</body>
</html>
"@
$Path = "C:\Scripts\User Facebook\"
Function Create-HTML {
Param ($username)
(Get-QADUser $username).DirectoryEntry.thumbnailPhoto | Set-Content "$Path$($username).jpg" -Encoding byte
If (Test-Path "$Path$($username).jpg") {
$imgName = "$username.jpg"}
Else {
$imgName = "Silhouette.jpg"
}
Get-QADUser $username |
Select-Object -Property @{n='Full Name';e={$_.Name}},
@{n='E-Mail';e={$_.EMail}},
@{n='Mobile Phone';e={$_.MobilePhone}},
department|
ConvertTo-HTML -Fragment -As List -PreContent "<img src='$imgName' alt='$username' /> <h2>$userName</h2>" | Out-String
}
$users = Get-QAduser -SearchRoot "OU=Somewhere,DC=Microsoft,DC=com"
$i = 0
$FirstRun =$true
Foreach ($user in $users) {
$i++
If ($i%2) {
$HTMLCenter += "<TR><TD>$(Create-HTML -username $user.samaccountname)</TD> `n"
}
Else {
Write-Verbose "Else $user.name $i"
$HTMLCenter += "<TD> $(Create-HTML -username $user.samaccountname)</TD></TR> `n"
}
}
$HTML = $HTMLBegin + $HTMLCenter + $HTMLEnd
$HTML |Out-File "$Path\Facebook.html"
Clear-Variable html,htmlbegin,htmlcenter,htmlend,i
|
Microsoft Powershell MVP
SIG> George Bernard Shaw : The power of accurate observation is commonly called cynicism by those who have not got it. </SIG>
You can read my blog at www.xipher.dk |
Edited by - Xenophane on 07/04/2012 08:29:18 AM |
 |
|
|
Xenophane
Honorable But Hopeless Addict
    
Denmark
3070 Posts
Status: offline |
Posted - 07/04/2012 : 08:23:29 AM
|
Looks something like this:
 |
Microsoft Powershell MVP
SIG> George Bernard Shaw : The power of accurate observation is commonly called cynicism by those who have not got it. </SIG>
You can read my blog at www.xipher.dk |
Edited by - Xenophane on 07/04/2012 08:24:33 AM |
 |
|
|
NMDANGE
Honorable But Hopeless Addict
    
USA
2054 Posts
Status: offline |
Posted - 07/04/2012 : 08:58:46 AM
|
Here's something I wrote in ASP.NET which gets its data out of Active Directory http://whitepages.pace.edu/
Would take some work to make it useable by other orgs though... |
Michael D'Angelo (former)MVP-MIIS, Pace University Senior Systems Administrator (Windows) (MS)NMDANGE PhoeniX WorX Systems Administrator. If you play Total Annihilation, please join us. http://www.phoenixworx.org |
 |
|
| |
Topic  |
|