本文介绍了附加到AD用户帐户描述属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我如何将此信息纳入下面的脚本中。我需要将AD用户帐户的描述属性

How do I incoroporate this into the script below. I need to Append/Add to the AD User Accounts' description property

附加/添加到 (Dor-Get-Date-IEM)标记为禁用。

flagged for disablement with (Dor-Get-Date-IEM).

#My Script

cls

导入模块activedirectory

$ 90days =(获取日期).AddDays(-90)

$ filepath =" C:\Temp \Dormant_Report _ $(Get-Date -Format yyyyMMddmm).csv"
$
$ splatter = @ {

    过滤= {

          enabled -eq $ True

          -and lastlogondate -le $ 90days                     


          -and(employeeType -like'E'-or employeetype -like'C'  -or employeetype -like'X'-or employeetype -like'A'-or employeetype -like'N')

      }
      Property = @(

                 'name',

                 'SurName',

                 'givenName',

                 'description',

                  'employeeType',

                  'employeeID',

                  'extensionAttribute15',

          &NBS磷;        'lastlogondate',

                  'passwordlastset'

                )

}

$ results = Get-ADUser @splatter

$ results | Export-Csv $ filepath -NoTypeInformation

$ results |禁用-ADAccount -Whatif

#My Script
cls
Import-module activedirectory
$90days = (get-date).AddDays(-90)
$filepath="C:\Temp\Dormant_Report_$(Get-Date -Format yyyyMMddmm).csv"
$splatter=@{
     Filter={
          enabled -eq $True
          -and lastlogondate -le $90days                      
          -and (employeeType -like 'E' -or employeetype -like 'C'  -or employeetype -like 'X' -or employeetype -like 'A' -or employeetype -like 'N')
      }
      Property=@(
                  'name',
                  'SurName',
                  'givenName',
                  'description',
                  'employeeType',
                  'employeeID',
                  'extensionAttribute15',
                  'lastlogondate',
                  'passwordlastset'
                )
}
$results=Get-ADUser @splatter
$results | Export-Csv $filepath -NoTypeInformation
$results | Disable-ADAccount -Whatif

推荐答案




这篇关于附加到AD用户帐户描述属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 23:31