Solved

powershell - modify accountexpires property

Posted on 2011-03-03
2
1,483 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will help you understand what HashTables are and how to use them in PowerShell.
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

752 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