Solved

Windows Storage Server 2003 File Server Role - Export Orphaned folders list to *.csv

Posted on 2010-09-01
16
613 Views
Last Modified: 2012-05-10
Trying to script an export of orphaned folders on a 2003 file server, we are migrating to a 2008 SP2 File Server. The 2003 server does not have powershell installed and the 2008 server can only be certified with Powershell 1.0. I previously exported all the usernames and HomeDirectories to excel and then dumped the folder list and did a compare. That was painfully slow and It gave me that outdated feeling, any help is appreciated.
0
Comment
Question by:dougasblack
[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
  • 7
  • 7
16 Comments
 

Author Comment

by:dougasblack
ID: 33582005
Requesting assistance with scripting
0
 
LVL 31

Expert Comment

by:Justin Owens
ID: 33586661
I am not sure I understand your Question.  Are you wanting a PowerShell script to find orphaned folders on your 2003 server even through PowerShell is not installed on it?  Do you want the script in VB?  What do you mean by "orphaned folders"?  My assumption would be empty folders, but I am not sure.  Also, what data do you want in the dump into your CSV file?

Justin
0
 

Author Comment

by:dougasblack
ID: 33587638
Sorry for the lack of clarity, the powershell can be on the 2008 Cluster.
And yes a wsh or vbscript would be required for the 2003 server.
Orphaned folders are deleted users former home directories,
csv or txt. would be ok.
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 31

Expert Comment

by:Justin Owens
ID: 33587863
So, to further clarify, you need a VBScript which polls AD for user accounts, and then compares that output to a list of home directories on your server.  The comparison would then output to a CSV file any folders in your home directory it finds which do not have a valid AD account present.

Is that correct?
0
 

Author Comment

by:dougasblack
ID: 33588758
2003 server yes, on the migrated to server  2008 - that could be powershell, but not 2.0 since the domain is still at 2003 r2 level. Quest QADUSER syntax creates a problem for iterating through the folders and htne checkiong AD for the sid state. I can do the discovery on either server, just informaing that the domain is 2003 r2.
0
 
LVL 31

Expert Comment

by:Justin Owens
ID: 33588813
Do the folder names match the AD names?  In other words, if John Doe's AD account is jdoe, will his user folder be named jdoe?
0
 

Author Comment

by:dougasblack
ID: 33589570
90%, user name sytanx is first initial;last initial: number.
So jDoe would be jd01, next JDoe would be jd02 etc.
Exec's and Managers can reqest a non - standard name.
Just initerested in the standard 90% of users.
0
 
LVL 31

Expert Comment

by:Justin Owens
ID: 33589746
OK, but the question is this: in your 90%, does the USER NAME always match the FOLDER NAME?
0
 

Author Comment

by:dougasblack
ID: 33589832
YES,
Sorry I did not understand your question previously,
the login name jd01@domainname , matches the folder name jd01
0
 
LVL 31

Expert Comment

by:Justin Owens
ID: 33617234
I have asked a Moderator to add this to the VBScript Zone for you.
0
 
LVL 31

Accepted Solution

by:
Justin Owens earned 500 total points
ID: 33639529
OK.... Here is something... I have a set of scripts I use, but because I have over 100,000 objects in AD, I had to get the script to accommodate that.  Basically, this script does exactly what you are looking for.  The programmer who wrote it is named Dave Sherman, and he has given me permission to publish it here.  The script pulls its search list from a file named "ShareList.txt" in the same directory as the script.  It is HUGE, but don't be intimidated.  It was written for a very large environment, but works in a small environment just fine.  I tested it in my home lab without error.  It basically looks at ShareList.txt for a list of shares.  After that, it enumerates the share list and searches for either an AD Account which matches the share name and failing that, searches AD for any user whose Home directory is a match.  If BOTH fail, it logs the folder in Logfile.xls.

Originally, the code used several pre-written libraries, but I got my onsite programmer to incorporate the libraries directly into the script.

Again, this worked on my home lab.  If you get any errors, post them and we will work through them.

Justin

homedircleanupnolib.vbs.txt
0
 

Author Comment

by:dougasblack
ID: 33640431
Got it, Ill let you know A.M. tomorrow. I'll kick it off before leaving tonight, thanks.
0
 

Author Comment

by:dougasblack
ID: 33649709
This Worked, I am now looking at the data set for false negatvies. So far it appears to have been very successful. Thanks
0
 
LVL 31

Expert Comment

by:Justin Owens
ID: 33649773
No problem... Just do me a favor, and if you reuse it in the future, be sure you don't pull Dave's name out of the comment lines. :)  He is rather proud of his work (as he has a right to be).

Justin
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

696 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