Solved

powershell - modify accountexpires property

Posted on 2011-03-03
2
1,478 Views
Last Modified: 2012-05-11
Hello,

I always get account expires one day higher in the output than it is in AD.

Please would you advice how to lower this value by one day? I tried it with adddays(-1), maybe somehow to convert it into shortdatestring, But I am not sure how to provide it.

Many thanks


Get-QADUser -xxx -LdapFilter "((!sAMAccountName=xx*)(!sAMAccountName=xx*))" -IncludeAllProperties | select displayname,samaccountname,description `
,({$_.accountexpires}).adddays(-1)

But this doesnt work
0
Comment
Question by:Radim88
  • 2
2 Comments
 

Accepted Solution

by:
Radim88 earned 0 total points
ID: 35025908
Thx I did it in this way:

{ (get-date($_.accountexpires)).adddays(-1)}
0
 

Author Closing Comment

by:Radim88
ID: 35025909
thx
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to sign a powershell script so you can prevent tampering, and only allow users to run authorised Powershell scripts
Synchronize a new Active Directory domain with an existing Office 365 tenant
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question