FOGProject / fogproject

An open source computer cloning & management system
https://fogproject.org
GNU General Public License v3.0
1.1k stars 221 forks source link

Running provisioning package (ppkg) to enroll to Microsoft Azure AD (Entra ID) #637

Open nssijt opened 1 week ago

nssijt commented 1 week ago

Hi all, is there any updated method or ways it can be less painful to run a provisioning package (ppkg) in a more automated way with fogproject?

I had wrote a simple batch file: powershell.exe Install-ProvisioningPackage -ForceInstall -PackagePath \demo.ppkg -QuietInstall

As I have tried putting the batch file together with the ppkg -> zip it -> deploy via fog's snap-in pack. It doesn't seems to be running.

Anyone has a more brilliant idea to share so that I can learn from all of you?

mastacontrola commented 1 week ago

I might suggest maybe output to a logfile on the root of your C: drive. This will at least potentially give you more information. I don't know how ppkg works, but if the thing is not able to be installed via the System user, this may also be a problem.

Basically in your logging I'd suggestin having "starting" "about to run" "ran" "complete" kind of messages:

Something like:

print "Starting Snapin operation" > 'c:\snapin_run_troubleshooting.log'

print "About to run command: powershell.exe Install-ProvisioningPackage -ForceInstall -PackagePath \demo.ppkg -QuietInstall" >> 'c:\snapin_run_troubleshooting.log"

powershell.exe Install-ProvisioningPackage -ForceInstall -PackagePath \demo.ppkg -QuietInstall >> 'c:\snapin_run_troubleshooting.log' # This allows the command to send its output to the log as well

print "Command should have ran please validate" >> 'c:\snapin_run_troubleshooting.log"

print "Snapin operation complete" >> 'c:\snapin_run_troubleshooting.log'
darksidemilk commented 1 week ago

I would suggest using powershell directly. i.e. I just tested this with success.

image

What this does:

I just tested this, ran it and then ran Get-ProvisioningPackage and the package was listed as installed. If it doesn't work we can look at adding more logging to it.

Other options for this specific use case would be to use group policy for enforcing enrollment into Azure/Entra AD.

nssijt commented 1 week ago

Wonderful and thank you both Tom and JJ Fuller for your detailed guidance. I am really appreciative of that. Let me get to my test environment to do a test and I shall get back if what JJ Fuller has suggested works.

Thanks again for both of your recommendation which I had been trying for several weeks without a single success with fog snap-in. I shall get back soon.

nssijt commented 1 week ago

Sorry I wasn't able to test it out as yet as I found that the issue is because of the initial provsioning package that I wasn't able to removed image

Not sure why, once i run the ppkg once, it cannot be removed for me to run another ppkg or the similar ppkg

I shall test and get back if JJ Fuller's script works on another machine probably after 12 Sep as it is crunch time for me this period