Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Powershell AD Query

$
0
0

Hi guys, apologies for the remedial nature of this, i'm very new to using power shell, I'm trying to get powershell to query active directory for the current user and output it to a text file in the format,

Display Name

Title

Telephone Number

Email Address

On top of each other like that to use as an email signature.

So far I have laughably arrived only at this!

Import-Module activedirectory

Get-ADUser ($env:UserName) -Properties DisplayName, Title, TelephoneNumber, EmailAddress | Out-File C:/........

I'm sure everyone except me realises this does not do that! If anyone could help me I'd really appreciate it before I pull out the scant remainder of my hair!!


Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>