Page 2 of 2 <12
Topic Options
#167603 - 2006-10-05 08:45 AM Re: How remove old Serverprofiles
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
If your not using Roaming profiles, you probably use a GPO redirect for the "My Documents" and the "Application Data" folders don't you ?
Top
#167604 - 2006-10-05 08:59 AM Re: How remove old Serverprofiles
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
A.
It is about the place where the Roaming Profiles are stored
Quote:


\\server\Profiles$\username




Top
#167605 - 2006-10-05 10:58 AM Re: How remove old Serverprofiles
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
I know Witto, I was referring to NTDOC's statement about "Roaming profiles are bad for you"
Anyway, it is simple, enumerate all users in AD compare the users to the folders using simple Dir() and if the user does not exists remove dir.

An example code to list the users:
Code:

Function ListADUsers
Dim $User, $Users
$Users = GetObject("WinNT://@ldomain")
$Users.filter = "User",""
For Each $User In $Users
? $User.Name
Next
EndFunction



Edited by apronk (2006-10-05 11:05 AM)

Top
#167606 - 2006-10-05 12:55 PM Re: How remove old Serverprofiles
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
No I don't use one but mainly due to the fact that the old data structure is still in place and I still need to move all the user data to a new location with real security settings. Right now everyone group has mod rights in most places.

I've started moving data but so many things going on I don't have time to dedicate yet to moving all the user data.

Very few people save to the My Documents they've been told many times not to save locally, so most don't now days.

Top
#167607 - 2006-10-05 01:14 PM Re: How remove old Serverprofiles
therob Offline
Starting to like KiXtart

Registered: 2005-05-19
Posts: 150
Loc: Frankfurt/M., Germany
Quote:

If your not using Roaming profiles, you probably use a GPO redirect for the "My Documents" and the "Application Data" folders don't you ?




Imho, its best to use both.
_________________________
Eternity is a long time, especially towards the end. - W.Allan

Top
#167608 - 2006-10-05 09:17 PM Re: How remove old Serverprofiles
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Okay so as not to continue to go off on our own agenda / soapboxes.


Back On Topic

Nexus - are you set? Do you have enough information to complete the requested task or do you need any more specific information to assist you.

Top
#167609 - 2006-10-05 10:50 PM Re: How remove old Serverprofiles
Nexus Offline
Fresh Scripter

Registered: 2006-03-10
Posts: 11
Loc: Germany
Hi

my script, delete still all folders.

Code:
  

call "D:\KIX\GroupMembers.udf"
call "D:\KIX\DirPlus.udf"

$members = groupmembers(@Domain,"Domain Users")

for each $member in $members
? $member

next

$folders = dirplus("D:\00", "/ad /s")


for each $folder in $folders
? $folder.name
? $folder.path

If AScan($Members, $folder.name) = -1
$folder.delete
EndIf
next



I have change in the script "$members" at name.

Code:

call "D:\KIX\GroupMembers.udf"
call "D:\KIX\DirPlus.udf"

$members = groupmembers(@Domain,"Domain Users")

for each $member in $members
? $member

next

$folders = dirplus("D:\00", "/ad /s")


for each $folder in $folders
? $folder.name
? $folder.path

If AScan(Test, $folder.name) = -1
$folder.delete
EndIf
next



Dirplus output:
Test
d:\00\test
test2
d:\00\test2

all subfolder are delete (test, test2) and he had to be delete only test2

can you check my script ?

Good Night

Top
#167610 - 2006-10-05 11:28 PM Re: How remove old Serverprofiles
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, your script won't work as "Test" is no array, thus your ascan() test returns always with the delete result.
put the array back.

then, change the ascan if to this:
Code:

If AScan($Members, $folder.name) = -1
? $folder.name " " $folder.delete
EndIf



compare this output with the members output before and you will what you have wrong in the script.

Top
Page 2 of 2 <12


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 382 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.06 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org