Solved

powershell - modify accountexpires property

Posted on 2011-03-03
2
1,461 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

How to sign a powershell script so you can prevent tampering, and only allow users to run authorised Powershell scripts
This article will help you understand what HashTables are and how to use them in PowerShell.
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now