Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

format output

$
0
0

foreach ($pcin$machine) {Get-ADComputer$pc-Properties*|selectname,LastLogonDate|out-filec:\temp\missing\LL.txt-Append}

 

foreach 

 

 

($pcin$machine) {(Get-ADComputer$pc-Properties*).LastLogonDate |out-filec:\temp\missing\LL.txt-Append}

The first line of code returns what I want, the computer name and the lastlogdate but the output is terrible.   It adds lots of ---------  and lots of white spaces.

The second line is what I want but it only gives me the LastLogonDate.  how do I juse the ). to get both the name and lastlogondate?

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles