|
|
|||||||
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. |
||||||||
|
|
|||||||
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? |
||||||||
|
|
|||||||
Hi I mean roaming profiles folders. Nexus |
||||||||
|
|
|||||||
I think I read something about this on the microsoft web pages Group Policy Recommendations for Roaming User Profiles Is this helpfull to you? |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
yes, that is what i mean |
||||||||
|
|
|||||||
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:
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... |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
right, but i guess thats not an option here. But, sometimes RP are the only way to go, e.g. in a terminalserver environment. |
||||||||
|
|
|||||||
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? |
||||||||
|
|
|||||||
You don't believe me very easily, witto, do you? |
||||||||
|
|
|||||||
Sorry, was a bit too long on this page and had not seen your answer yet. I think I just had the same thought. |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
Quote: 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. |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
Hi I would like with UDF "dirplus" and "GroupMembers" erased my users folders. Script: Code:
but it become erased all folders. |
||||||||
|
|
|||||||
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:
|
||||||||
|
|
|||||||
Quote: if so, your problem is gone, isn't it? *scnr* |
||||||||
|
|
|||||||
If your not using Roaming profiles, you probably use a GPO redirect for the "My Documents" and the "Application Data" folders don't you ? |
||||||||
|
|
|||||||
A. It is about the place where the Roaming Profiles are stored Quote: |
||||||||
|
|
|||||||
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:
|
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
Quote: Imho, its best to use both. |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
Hi my script, delete still all folders. Code:
I have change in the script "$members" at name. Code:
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 |
||||||||
|
|
|||||||
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:
compare this output with the members output before and you will what you have wrong in the script. |