Page 1 of 2 12>
Topic Options
#167583 - 06/09/13 08:26 PM How remove old Serverprofiles
Nexus Offline
Fresh Scripter

Registered: 06/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
#167584 - 06/09/13 09:02 PM Re: How remove old Serverprofiles
Mart Moderator Offline
KiX Supporter
*****

Registered: 02/03/27
Posts: 4612
Loc: The Netherlands
Do you mean user profiles that are created when a users logs onto the server for example on a terminal server or do you mean the roaming profiles folders?
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#167585 - 06/09/14 04:56 PM Re: How remove old Serverprofiles
Nexus Offline
Fresh Scripter

Registered: 06/03/10
Posts: 11
Loc: Germany
Hi

I mean roaming profiles folders.

Nexus

Top
#167586 - 06/09/14 05:03 PM Re: How remove old Serverprofiles
Witto Offline
MM club member
*****

Registered: 04/09/29
Posts: 1828
Loc: Belgium
I think I read something about this on the microsoft web pages
Group Policy Recommendations for Roaming User Profiles
Is this helpfull to you?

Top
#167587 - 06/09/15 05:30 PM Re: How remove old Serverprofiles
therob Offline
Starting to like KiXtart

Registered: 05/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 - 06/09/26 08:46 AM Re: How remove old Serverprofiles
Nexus Offline
Fresh Scripter

Registered: 06/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
#167589 - 06/09/26 09:06 AM Re: How remove old Serverprofiles
Witto Offline
MM club member
*****

Registered: 04/09/29
Posts: 1828
Loc: Belgium
I think you want to list all your existing domain users and check for every directory in \\server\Profiles$\ if it is in this list. If it is not, do something to delete it.
Top
#167590 - 06/09/26 11:04 AM Re: How remove old Serverprofiles
Nexus Offline
Fresh Scripter

Registered: 06/03/10
Posts: 11
Loc: Germany
yes, that is what i mean
Top
#167591 - 06/09/26 01:59 PM Re: How remove old Serverprofiles
therob Offline
Starting to like KiXtart

Registered: 05/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
#167592 - 06/09/26 09:10 PM Re: How remove old Serverprofiles
NTDOC Administrator Offline
Administrator
*****

Registered: 00/07/28
Posts: 11547
Loc: CA
Or just quit using ROAMING profiles period.

I know a lot of places use them, just glad I don't work at any of those locations.

SLOW SLOW SLOW PITA

Top
#167593 - 06/09/26 10:16 PM Re: How remove old Serverprofiles
therob Offline
Starting to like KiXtart

Registered: 05/05/19
Posts: 150
Loc: Frankfurt/M., Germany
right, but i guess thats not an option here. But, sometimes RP are the only way to go, e.g. in a terminalserver environment.
Top
#167594 - 06/09/26 10:21 PM Re: How remove old Serverprofiles
Witto Offline
MM club member
*****

Registered: 04/09/29
Posts: 1828
Loc: Belgium
Doc,
What if you have some (citrix) terminal servers (in a farm) hosting the same soft? Isn't it preferable getting the same environment back as you left it?

Top
#167595 - 06/09/26 10:24 PM Re: How remove old Serverprofiles
therob Offline
Starting to like KiXtart

Registered: 05/05/19
Posts: 150
Loc: Frankfurt/M., Germany
You don't believe me very easily, witto, do you?
Top
#167596 - 06/09/26 10:27 PM Re: How remove old Serverprofiles
Witto Offline
MM club member
*****

Registered: 04/09/29
Posts: 1828
Loc: Belgium
Sorry, was a bit too long on this page and had not seen your answer yet.
I think I just had the same thought.

Top
#167597 - 06/09/26 10:52 PM Re: How remove old Serverprofiles
NTDOC Administrator Offline
Administrator
*****

Registered: 00/07/28
Posts: 11547
Loc: CA
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)

I mean there are shops that use Roaming Profiles on their local Workstations with no TS involved.
To me that is a real Roaming Profile - and I personally don't care for them myself.


Edited by NTDOC (06/09/26 10:53 PM)

Top
#167598 - 06/09/26 11:16 PM Re: How remove old Serverprofiles
therob Offline
Starting to like KiXtart

Registered: 05/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 - 06/09/27 12:02 AM Re: How remove old Serverprofiles
NTDOC Administrator Offline
Administrator
*****

Registered: 00/07/28
Posts: 11547
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 - 06/10/04 08:50 PM Re: How remove old Serverprofiles
Nexus Offline
Fresh Scripter

Registered: 06/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 (06/10/04 08:52 PM)

Top
#167601 - 06/10/04 10:47 PM Re: How remove old Serverprofiles
Witto Offline
MM club member
*****

Registered: 04/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 - 06/10/04 11:27 PM Re: How remove old Serverprofiles
therob Offline
Starting to like KiXtart

Registered: 05/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
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Chris S., Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
3 registered (BradV, AndrewRoom, Arend_) and 147 anonymous users online.
Newest Members
AndrewRoom, 000Raph000, curkus, Ken_Sumrall, Keris2112
17455 Registered Users

Generated in 0.078 seconds in which 0.027 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