Click here to Skip to main content
15,902,189 members

Comments by namerg (Top 28 by date)

namerg 16-Oct-14 15:42pm View    
Windows user....i think i figured it out, maybe you can help me with the following on the note variable: $note = $env:username.ToUpper(),$FullName.GivenName,$FullName.Surname,"{0} {1} to {2}" -f (Get-Date),$status.ToUpper(),$env:computername

I added the following:
$note | Select Username,FirsName,LastName,Date,Time,State, ComputerName | Export-Csv "C:\scripts\ActiveDirectory\clocktime.csv" -nti

But the contents of clocktime.csv has the following:
"Username","FirsName","LastName","Date","Time","State","ComputerName"
,,,,,,
namerg 16-Oct-14 13:22pm View    
Deleted
By the way, i get the following error when i run it locally:

PS C:\scripts\ActiveDirectory> $note = "{0} {1} to {2}" -f (Get-Date),$status.ToUpper(),$env:computername
You cannot call a method on a null-valued expression.
At line:1 char:1
+ $note = "{0} {1} to {2}" -f (Get-Date),$status.ToUpper(),$env:computername
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
namerg 2-Apr-13 17:11pm View    
I really do not know very well powershell but i figured it out.
namerg 2-Apr-13 14:57pm View    
14401 is variable and they are time stamped daily
namerg 2-Apr-13 14:50pm View    
Let me rephrase my goal:
The are five files: YYYYMMDD_whatever_clm.txt, YYYYMMDD_whatever_proc.txt,YYYYMMDD_whatever_pym.txt,YYYYMMDD_whatever_pymt_li.txt,YYYYMMDD_whatever_cc.txt
20130327_14401_clm.txt
20130327_14401_proc.txt
20130327_14401_pymt.txt
20130327_14401_pymt_li.txt
20130325_14401_cc.txt
To Do: Need to check the existence of *_clm.txt,*_proc.txt,*_pymt.txt and *_pymt_li.txt from Monday to Friday. But, on Monday need to check the existence of only the *_cc.txt