#167583 - 2006-09-13 08:26 PM
How remove old Serverprofiles
|
Nexus
Fresh Scripter
Registered: 2006-03-10
Posts: 11
Loc: Germany
|
Hi
How can remove old Serverprofiles.
read in the ADS all user and compare with serverprofiles. If serverprofile (Folder) not equal with username remove this serverprofile.
|
Top
|
|
|
|
#167585 - 2006-09-14 04:56 PM
Re: How remove old Serverprofiles
|
Nexus
Fresh Scripter
Registered: 2006-03-10
Posts: 11
Loc: Germany
|
Hi
I mean roaming profiles folders.
Nexus
|
Top
|
|
|
|
#167587 - 2006-09-15 05:30 PM
Re: How remove old Serverprofiles
|
therob
Starting to like KiXtart
Registered: 2005-05-19
Posts: 150
Loc: Frankfurt/M., Germany
|
Yes, GPOs are the best way to go. If you can't/won't use GPOs, there a tool that can delete profiles: DelProf
But if i understand it right, you have a bunch of old profiles on your profile-share, and the useraccounts which they belonged to are already gone? Mhm, that would be not an fast and easy task, but depends on how many profiles you got, if its faster to do it manually. For the future i would implement somthing that deletes them automatically if a user gets deleted.
If it has to be scripted, you would need to read all users from AD, read all the folder names and compare them to each other. At least for the first two tasks (if not for all) you find UDFs here in the forum, for the third i could help you.
|
Top
|
|
|
|
#167588 - 2006-09-26 08:46 AM
Re: How remove old Serverprofiles
|
Nexus
Fresh Scripter
Registered: 2006-03-10
Posts: 11
Loc: Germany
|
No, I meant the user profiles on the server are filed.
For example:
\\server\Profiles$\username
Check in the Active Directory the users and compare the userprofile on the server, if not the same delete userprofile.
|
Top
|
|
|
|
#167590 - 2006-09-26 11:04 AM
Re: How remove old Serverprofiles
|
Nexus
Fresh Scripter
Registered: 2006-03-10
Posts: 11
Loc: Germany
|
yes, that is what i mean
|
Top
|
|
|
|
#167591 - 2006-09-26 01:59 PM
Re: How remove old Serverprofiles
|
therob
Starting to like KiXtart
Registered: 2005-05-19
Posts: 150
Loc: Frankfurt/M., Germany
|
isnt that what i said?
Anyway, for reading all the foldernames into a file, you can use this: DirPlus ()
Then, the easiest way would be to check for every User/Foldername in the AD (depends on how many users you've got, if its a too heavy load for your DC) For this you could e.g. use that simple UDF:
Code:
Function userexist ($adloginname)
$userpath = "LDAP://cn="+$adloginname+",ou=OrganisationUnit,dc=subdomain,dc=domain,dc=com" $UserObj = GetObject($userpath) If @ERROR $accountexist = 0 Else $accountexist = 1 EndIf
EndFunction
But there are multiple ways, depending on your needs. You can also read all memebers of a certain group (AllUSERS) to a file and compare them to the folderfile, or just check for groupmembership with INGROUP (). And so on...
|
Top
|
|
|
|
#167595 - 2006-09-26 10:24 PM
Re: How remove old Serverprofiles
|
therob
Starting to like KiXtart
Registered: 2005-05-19
Posts: 150
Loc: Frankfurt/M., Germany
|
You don't believe me very easily, witto, do you?
|
Top
|
|
|
|
#167598 - 2006-09-26 11:16 PM
Re: How remove old Serverprofiles
|
therob
Starting to like KiXtart
Registered: 2005-05-19
Posts: 150
Loc: Frankfurt/M., Germany
|
Quote:
Terminal Server is not the same as Roaming Profiles (imho, though MS may beg to differ, I see it as a LOCAL profile on a TS)
mhm i'm not sure i got ya. For the terminalserver profiles, its quite the same, as the TS emulates your local PC (if you using a published app or even a desktop). You can store the profiles on the TS (thats the default, without roaming), but then you would have a profile on every TS (assuming you have usually more than one). So you would have the same problems as if you would using a different workstation every day. So the only difference is, TS-roamingprofiles are loading usually much faster, because the fileserver where the profiles are located is usually (or at least, should be) connected with the TS through a fast backend.
_________________________
Eternity is a long time, especially towards the end. - W.Allan
|
Top
|
|
|
|
#167599 - 2006-09-27 12:02 AM
Re: How remove old Serverprofiles
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
Well not trying to explain TS and pros/cons of profiles.
Take TS out of the mix and not a question to me. If I'm running the system I'm not going to use RP.
Thats all
|
Top
|
|
|
|
#167600 - 2006-10-04 08:50 PM
Re: How remove old Serverprofiles
|
Nexus
Fresh Scripter
Registered: 2006-03-10
Posts: 11
Loc: Germany
|
Hi
I would like with UDF "dirplus" and "GroupMembers" erased my users folders.
Script:
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:\Clients\Profiles", "/ad /s")
for each $folder in $folders ? $folder.name ? $folder.path
if $folder.name = "$member"
else $folder.delete endif next
but it become erased all folders.
Edited by Nexus (2006-10-04 08:52 PM)
|
Top
|
|
|
|
#167601 - 2006-10-04 10:47 PM
Re: How remove old Serverprofiles
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
I think you should AScan the $members array for the existance of $Folder.Name . If it is not in the Array, you want to delete it. I presume this code will work better... Maybe you can test it on your folder with test directories Code:
If AScan($Members, $folder.name) = -1 $folder.delete EndIf
|
Top
|
|
|
|
#167602 - 2006-10-04 11:27 PM
Re: How remove old Serverprofiles
|
therob
Starting to like KiXtart
Registered: 2005-05-19
Posts: 150
Loc: Frankfurt/M., Germany
|
Quote:
but it become erased all folders.
if so, your problem is gone, isn't it? *scnr*
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 980 anonymous users online.
|
|
|