14634
Dec 13, 2010, updated at 08:15:04 (UTC)
3374
0
1
Finde fehler nicht in Script
HAllo, habe folgendes program:
$COMPAREDATE=GET-DATE
$NumberDays=360
$CSVFileLocation='C:\OldComps.CSV'
GET-QADCOMPUTER -SizeLimit 0 -IncludedProperties LastLogonTimeStamp | where { ($CompareDate-$_.LastLogonTimeStamp).Days -gt $NumberDays } | Select-Object Name, LastLogonTimeStamp, OSName, ParentContainerDN | Sort-Object ModificationDate, Name | Export-CSV $CSVFileLocation
Leider bekomme ich immer diesen Fehler:
Ich weiß aber nicht was ich da falsch gemacht habe!?
[Edit Biber] Codeformatierung [/Edit]
$COMPAREDATE=GET-DATE
$NumberDays=360
$CSVFileLocation='C:\OldComps.CSV'
GET-QADCOMPUTER -SizeLimit 0 -IncludedProperties LastLogonTimeStamp | where { ($CompareDate-$_.LastLogonTimeStamp).Days -gt $NumberDays } | Select-Object Name, LastLogonTimeStamp, OSName, ParentContainerDN | Sort-Object ModificationDate, Name | Export-CSV $CSVFileLocation
Leider bekomme ich immer diesen Fehler:
Cannot find an overload for "op_Subtraction" and the argument count: "2".
At H:\Desktop\alte PC\TEST.ps1:4 char:93
+ GET-QADCOMPUTER -SizeLimit 0 -IncludedProperties LastLogonTimeStamp | where { ($CompareDate- <<<< $
_.LastLogonTimeStamp).Days -gt $NumberDays } | Select-Object Name, LastLogonTimeStamp, OSName, Parent
ContainerDN | Sort-Object ModificationDate, Name | Export-CSV $CSVFileLocation
+ CategoryInfo : NotSpecified: (:) , MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
[Edit Biber] Codeformatierung [/Edit]
Please also mark the comments that contributed to the solution of the article
Content-Key: 156853
Url: https://administrator.de/contentid/156853
Printed on: May 4, 2024 at 12:05 o'clock