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

bsharath
bsharath used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Systems Engineer
Top Expert 2007
Commented:
Try following in startup batch script:
FSUtil FSInfo Drives >"\\SERVER\SHARE\%COMPUTERNAME%.txt"

Open in new window

leakim971Multitechnician
Top Expert 2014

Commented:
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

leakim971Multitechnician
Top Expert 2014

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

Author

Commented:
I want a script to be used as a stratup script in Active directory

Author

Commented:
Thanks Farhan

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial