-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not connect to #38
Comments
You need to make sure that WinRM are activated on the computer you want to execute it against |
I checked it; PS C:\Users\adminbe> test-wsman -ComputerName "Laptop1" checked on the local machine, ie Laptop1 same reply I did a ; also as i said it pulls the list of profiles so it is communicating with the remote machine, but obviously there is something in the code/command that it fails on. |
Interesting, I did try it before I did publish it. |
@DoubleJCream did you try to use it with full FQDN? |
I loaded up the script, i am certainly no powershell expert but it seems that in the first function; however that loop is not defined in the function; I switched the variable from $_computer to $ComputerName which is defined from the command call and it seems not to report that error - i'll have to check tomorrow if its actually working but i think the issue lies that $_computer isn't defined. PS - i tried with fqdn (same error) and working in PS 7.3 / 7.4 |
ok - i think i have it working now - it would be nice to have a bit more of an interactive menu; ie list the profiles and choose which ones to delete, but at lease the script is working i think in the way you wanted it to. So i think in the Remove-RSUserProfile it is missing the loop for defining $_computer as mentioned above. Also, there is an issue in the Function Confirm-RSProfile where you have the 3 parameters defined as mandatory, but in the case where you only want to delete one profile you have the call (function Remove-RSUserProfile); as you see there is only 2 parameters passed, so the script waits for input of the 3rd parameter. i hope this helps, let me know if i can be of any help |
Yeah that's a bug, was looking over the code now. I'll update the module as soon as possible. Thanks for seeing it, have been swamped with work so I haven't had time for it. |
hey, no worries, i would need a clone or live another lifetime to get all the stuff done! look forward to the update when you can. |
OK so how do I fix this I understand nothing of what you spoke about I just know the module could not delete user with the connect error. |
I think for you there are 2 ways to approach this, which depend on you;
let me know. |
I'll try to re-write it tomorrow, got some time in the morning. |
Hi, To install it uninstall the old module first.
Then install the dependency module, it's req for the new version.
Then install the pre-release module
Please confirm if it's working for you or not, I did just fix it up quickly and did a run with it. |
Hey rstolpe;
i didn't have a lot of time to look at it but i'm guessing its the call to the function from; But then in the function: Function Confirm-RSProfile Since my command was a simple delete; there is no $Exclude variable defined but when it is passed to the Confirm-RSProfile, the variable $Exclude will be null which then is caught by [ValidateNotNullOrEmpty()] my guess is that you would need two calls depending on if $Exclude is defined / or not, that or b option is to pull the [ValidateNotNullOrEmpty()] line but that could lead to other problems. I'll leave this with you - let me know if i can do anything. thanks |
Your totally right, to be honest I haven't had the time to look or the module yet. |
Hi
I just tried using your script to wipe some extra profiles off some of my users laptops and initially i had to allow the PS Man through the firewall - when i run the command
Get-RSUserProfile -ComputerName "Laptop1"
i get the listing of the profiles, however when i run the command;
Remove-RSUserProfile -ComputerName "Laptop1" -UserName "User1"
I get the error;
Could not connect to trough WinRM, please check the connection and try again
so just wondering if you know what is missing? The first indication is that it isn't displaying the computer name. I see in the code that its doing this mostly through cim session - not sure if the Get-RSUserProfile uses that as well and if so why its not working for Remove-RSUserProfile.
Let me know if you have any ideas.
PS - small typo - the spelling should be '.. through WinRM'
thanks
The text was updated successfully, but these errors were encountered: