A user asked for a script that logs off a user and renames their FSLogix profile on the share. ControlUp suggested two ways to accomplish the task depending on group policy settings. If FSLogix is set for "Access network as computer," a script action executed in the machine context would work. If not, the ControlUp console user’s permission needs to be granted on the profile share. A script would need parameters for the Session Id, FSLogix Profile Container Path, and User. The old profile will be renamed while the new one is created for the helpdesk to give users.
Read the entire ‘Renaming FSLogix Profiles with ControlUp Scripts’ thread below:
Had an idea for a script that logs off a particular user, and renames their fslogix profile on the profile share. Any thoughts on how this could be done? Assuming the user running the controlup console has permissions to touch the users profile on the share both permission-wise and network-wise. Or that the profile-renaming is initiated from the VDA..
Tagging @member and @member
Interesting idea, why are you looking to rename the profile?
ControlUp gives a couple ways this can be accomplished with our script action execution context depending on how FSLogix is configured and the permissions on the file share.
https://admx.help/?Category=FSLogixApps&Policy=FSLogix.Policies::944266be3eb268125de24d6ecaa5365d
1 – FSLogix is configured for "Access Network as computer"
If FSLogix is configured with this group policy object then you can create a script action that executes in the machine context. The computer’s permissions should be able to do the modification. This is the "profile renaming is initiated from the VDA" you are looking for
2 – FSLogix is NOT configured for "Access network as computer" this means in a secure environment that only the user will have access to their profile share.
If you can grant the ControlUp console user permission to the FSLogix profile share with permissions to modify the vhdx file, then it should be trivial to solve this issue.
The script would have a couple parameters that could be passed to it.
a) Session Id
b) FSLogix Profile Container Path
c) User
The script action could then do a (psudeocode):
“`logoff.exe $SessionId
add wait check that the user is logged off
Get VHDX file
$VHDXFile = get-childitem "$FSLogixPath\$user*.vhdx #whatever your path maybe
may need a check to ensure only one VHDX file was found
Rename $VHDXFile.fullname NewName“`
renaming to give the user a new profile while keeping the old for backup
but thanks, will give it a try. will make it easier for our helpdesk to give users a new profile without identifying fslogix share across customers
is the fslogix profile path not a record property available in the user session? 😞
Continue reading and comment on the thread ‘Renaming FSLogix Profiles with ControlUp Scripts’. Not a member? Join Here!
Categories: All Archives, ControlUp Scripts & Triggers