Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Below I have a form for PC Refresh you select a Old Backed up Computer from a drop down list (Left Side). The New Computer is the Computer your logged on to (Right Side). The tech fills in the data for the new computer and Submits the form (Button Not Shown). The AD attributes are updated and a LOADSTATE is run restoring the New Computer. I also want to disable the old computer. The problem is only 1 line of these two lines of code executes. I can comment out the LOADSTATE code and the computer is disabled in AD. I can comment out the dsmod code and the LOADSTATE will execute. When both are uncommented the second line of code does not execute? (Please see UI and Code on Submit_Click).
$labelDialogRedRestore.Text ="AD computer object not found"
}
}
My question is do you see any obvious problem with the code which would cause this. I am using dsmod because RSTAT Tools are not installed on these computers (would be easier if it were). this .exe is run from a server share.
The commands do not wait when executed from a form.
I recommend make this work without any reporting in a simple scrip executed from a PowerShell CLI script.
When you get this working add it to a job and then report on job progress.
Thanks for that. I just figured it out. Our PC Refresh team removed the C:\Windows\System32\dsmod.exe file from their IMAGE. Therefore it was not working on the newly re-imaged computers (it had been working). My development computer had that system file so it worked but it has to have that file to work. Sorry for the inconvenience. Thanks for your prompt response. Below is the code I used to return the GUI errors while the applicaiton was running. Found on your site from back in may of 2015. Thanks for the site.
This topic is 7 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.