PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.win.server.scripting > RE: How to get accts created in last 7 days
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
RE: How to get accts created in last 7 days

Réponse
 
LinkBack Outils de la discussion
Vieux 22/11/2007, 19h59   #1
Andrew Karmadanov
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RE: How to get accts created in last 7 days

You can use PowerShell Cmdlets for Active Directory
from here
http://www.quest.com/2_0/default.asp...estdefid=13255

and the following script

######################################33
$Excel = New-Object -com "Excel.Application"
$WorkBook = $Excel.Workbooks.Open("C:\work\1.xls")
$Sheet = $WorkBook.Worksheets.Item("Sheet1")

$OU = "domain.com/enterprise/division/users"
$Date = Date
$Date.AddDays(-7) > $Null

$Users = Get-QADUser -SearchRoot $OU -SearchScope subtree
-includeallproperties

$n = 1
foreach ($User in $Users)
{
if ($User.creationdate -gt ([datetime]$Date))
{
$Sheet.Cells.Item($n,1).Value2 = $user.displayname
$Sheet.Cells.Item($n,2).Value2 = $user.creationdate
$Sheet.Cells.Item($n,3).Value2 = $user.homedirectory
$Sheet.Cells.Item($n,4).Value2 = $user.profilepath
$n++
}
}


$WorkBook.Save()
$WorkBook.Close()
$Excel.Quit()

Andrew

"Wizzy" wrote:

> Hi,
>
> I would like to know how to get a list of xp accts created in an OU in past
> 7 days along with their creation date, home drive path & profile path. I
> would like the output of the script to be directed to an excel file with each
> type of attribute in different coumns. Kindly advise!!
> --
> Regards,
> Wizzy

  Réponse avec citation
Vieux 24/11/2007, 03h06   #2
Al Dunbar
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to get accts created in last 7 days

And, as an aside, these are not XP accounts, but Active Directory Accounts.

/Al

"Andrew Karmadanov" <Andrew Karmadanov@discussions.microsoft.com> wrote in
message news:295EFE54-EF08-4C13-A835-CE722050B5B0@microsoft.com...
> You can use PowerShell Cmdlets for Active Directory
> from here
> http://www.quest.com/2_0/default.asp...estdefid=13255
>
> and the following script
>
> ######################################33
> $Excel = New-Object -com "Excel.Application"
> $WorkBook = $Excel.Workbooks.Open("C:\work\1.xls")
> $Sheet = $WorkBook.Worksheets.Item("Sheet1")
>
> $OU = "domain.com/enterprise/division/users"
> $Date = Date
> $Date.AddDays(-7) > $Null
>
> $Users = Get-QADUser -SearchRoot $OU -SearchScope subtree
> -includeallproperties
>
> $n = 1
> foreach ($User in $Users)
> {
> if ($User.creationdate -gt ([datetime]$Date))
> {
> $Sheet.Cells.Item($n,1).Value2 = $user.displayname
> $Sheet.Cells.Item($n,2).Value2 = $user.creationdate
> $Sheet.Cells.Item($n,3).Value2 = $user.homedirectory
> $Sheet.Cells.Item($n,4).Value2 = $user.profilepath
> $n++
> }
> }
>
>
> $WorkBook.Save()
> $WorkBook.Close()
> $Excel.Quit()
>
> Andrew
>
> "Wizzy" wrote:
>
>> Hi,
>>
>> I would like to know how to get a list of xp accts created in an OU in
>> past
>> 7 days along with their creation date, home drive path & profile path. I
>> would like the output of the script to be directed to an excel file with
>> each
>> type of attribute in different coumns. Kindly advise!!
>> --
>> Regards,
>> Wizzy



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h26.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11213 seconds with 10 queries