Link to home
Start Free TrialLog in
Avatar of bsharath
bsharathFlag for India

asked on

Script that can be used in AD as a startup script that can record the drives in a machine.

Hi,

Script that can be used in AD as a startup script that can record the drives in a machine.
Like
Machinename|C,D,E,F

All into 1 csv if possible. Or 1 txt file for each machine.

Regards
Sharath
ASKER CERTIFIED SOLUTION
Avatar of Farhan Kazi
Farhan Kazi
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of leakim971
Hello bsharath,

Create a lists of computers (c:\computers.txt). First row is column name, set it to computer.
You create a file c:\drives.csv

Regards

Working script :

Import-CSV c:\computers.txt | foreach-object { Get-WmiObject win32_logicaldisk -computername $_.computer } | Select __SERVER, DeviceID | Export-CSV c:\drives.csv

Open in new window

Sorry : You create a file c:\drives.csv ---> You will GET a file c:\drives.csv

Avatar of bsharath

ASKER

I want a script to be used as a stratup script in Active directory
Thanks Farhan