Microsoft 365 install / update via snapin pack
-
Hello,
I created a snapin pack to Install Microsoft 365 that fog registers as successful run while it is not working.
I already searched the forum and found similar attempts to install Microsoft 365, but none of the Topics are marked “solved”.
My snapin pack has the structure:
./install.cmd ./Setup/setup.exe ./Setup/MS365-config-64-bit.xml
Fog runs install.cmd which looks like:
net use x: \\truenas\MS365 /USER:Guest /PERSISTENT:NO %~dp0Setup\setup.exe /configure %~dp0Setup\MS365-config-64-bit.xml net use x: /DELETE
The relevant parts of the setup configuration .XML file are:
<Configuration ID="5c579236-99be-41f4-ba55-91c6e3c0e212"> <Info Description="Test" /> <Add OfficeClientEdition="64" Channel="Current" SourcePath="x:" AllowCdnFallback="TRUE"> <Product ID="O365ProPlusRetail"> <Language ID="de-de" /> <Language ID="en-us" /> </Product> </Add> <Updates Enabled="TRUE" UpdatePath="x:" /> <RemoveMSI /> <Display Level="None" AcceptEULA="TRUE" /> </Configuration>
Running install.cmd as local Administrator from a command line with elevated privileges in a machine belonging to an AD is working fine.
Running it via the analogue command to cmd.exe /c "[FOG_SNAPIN_PATH]\install.cmd, which is generated on the snapin pack page, with the full path via “RUN” on windows I get the same result (a popup window from setup.exe) as from a non-privileged command line. Therefore I think it should work when fog runs it as privileged SYSTEM user.
Running it via snapin on the same machine creates a “successful” run with exit code 0 and a runtime of 2 seconds.
The fog client log contains:
07.03.2024 08:54:05 Client-Info Client Version: 0.13.0 07.03.2024 08:54:05 Client-Info Client OS: Windows 07.03.2024 08:54:05 Client-Info Server Version: 1.5.10 07.03.2024 08:54:05 Middleware::Response Success 07.03.2024 08:54:05 SnapinClient Running snapin Install Microsoft 365 07.03.2024 08:54:05 Middleware::Communication Download: https://192.168.0.43/fog/service/snapins.file.php?mac=44:37:E6:6F:32:8F&taskid=1376 07.03.2024 08:54:06 SnapinClient C:\Program Files (x86)\FOG\tmp\MS365-x64-2.zip 07.03.2024 08:54:06 SnapinClient Processing SnapinPack MS365-x64-2.zip 07.03.2024 08:54:06 SnapinClient Extracting SnapinPack 07.03.2024 08:54:06 Bus Emmiting message on channel: Notification 07.03.2024 08:54:06 SnapinClient Starting snapin 07.03.2024 08:54:06 SnapinClient Snapin finished 07.03.2024 08:54:06 SnapinClient Return Code: 0 07.03.2024 08:54:06 Bus Emmiting message on channel: Notification 07.03.2024 08:54:06 Middleware::Communication URL: https://192.168.0.43/fog/service/snapins.checkin.php?taskid=1376&exitcode=0&mac=44:37:E6:6F:32:8F&newService&json
Any hint on how to enable a higher log level on the client or alternative attempts to either debug the problem or another way to install / update Microsoft 365 would be highly appreciated.
Thanks,
Paul
-
@pauleb I use this powershell script for my M365 snappin. Hope it helps you.
$username = "DOMAIN\USERNAME" $password = ConvertTo-SecureString "PASSWORD" -AsPlainText -Force $creds = New-Object System.Management.Automation.PSCredential $username, $password New-PSDrive -Persist -Name "Z" -PSProvider FileSystem -Root "\\SHARE\AppRepo" -Credential $creds Start-Process -Wait -FilePath "Z:\Microsoft\Microsoft365_x64\setup.exe" -ArgumentList '/configure "Z:\Microsoft\Microsoft365_x64\configuration.xml"' -NoNewWindow Remove-PSDrive -Name "Z"
-
I just saw, that it is a duplicate of https://forums.fogproject.org/topic/12484/office-deployment-toolkit-2016-snapin-problem - sorry.
Nonetheless, maybe there are solutions / better options now.
-
@pauleb I use this powershell script for my M365 snappin. Hope it helps you.
$username = "DOMAIN\USERNAME" $password = ConvertTo-SecureString "PASSWORD" -AsPlainText -Force $creds = New-Object System.Management.Automation.PSCredential $username, $password New-PSDrive -Persist -Name "Z" -PSProvider FileSystem -Root "\\SHARE\AppRepo" -Credential $creds Start-Process -Wait -FilePath "Z:\Microsoft\Microsoft365_x64\setup.exe" -ArgumentList '/configure "Z:\Microsoft\Microsoft365_x64\configuration.xml"' -NoNewWindow Remove-PSDrive -Name "Z"
-
I simply dropped the OfficeSetup.exe into the snapin and left everything else as is. It will install office or update Office if it is already installed.
-
@rodluz Thanks a lot!
Your script is working flawlessly!
Since it is doing more or less the same as mine with the difference, that you execute the setup from the mounted drive I also tried adapting my batch script.
It seems it also works when the executable is ran from the temporarily mounted drive.
net use z: \\truenas\MS365 /USER:Guest /PERSISTENT:NO z:\Setup\setup.exe /customize z:\Setup\MS365-config-64-bit.xml net use z: /DELETE
and changing my configuration .XML file to:
<Configuration ID="5c579236-99be-41f4-ba55-91c6e3c0e212"> <Info Description="Test" /> <Add OfficeClientEdition="64" Channel="Current" SourcePath="Z:\x64\" AllowCdnFallback="TRUE"> <Product ID="O365ProPlusRetail"> <Language ID="de-de" /> <Language ID="en-us" /> </Product> </Add> <Updates Enabled="TRUE" UpdatePath="Z:\x64\" /> <RemoveMSI /> <Display Level="None" AcceptEULA="TRUE" /> </Configuration>
Since nothing but the location of the executable and the config file changed I still cannot see where I went wrong. Since fog told me the snapin ran, I suppose that %~p0 worked as path substitution. It also is working in another snapin pack I use. So I can’t see why my snapin pack solution did not work.
So much for documenting my results here.
Thanks again!!
-
@DBCountMan
Thanks for your feedback, I am not sure what OfficeSetup.exe file you are using.I wanted to configure Office on the fly when installing and update configuration. Therefore I preferred to use the solution offered by Microsoft via the Office deployment Tool and to create a configuration with the Office Customization Tool. Therefore I went with @rodluz 's solution.
-
-
@pauleb When a 365 user logs into portal.office365.com and then goes to my account>install apps, they can download the Office installer, officesetup.exe. This is an online installer for Office.
-
Thanks for the update. Nice to know that this is also working.
My searches just showed using the office deployment tool and since I couldn’t be sure, that there is no user / license specific information in the setup - file and I don’t want to get into licensing issues with Microsoft I did not even try this. -
@pauleb In our environment, pre-365 and pre-1G internet, we would use deployment tools to deploy Office from our local repositories using scripts and XMLs. For licensing we used KMS. Now with 365, all licensing is handled on the cloud, and we can install Office apps via internet. The OfficeSetup.exe file has no licensing embedded in it. It is simply a thin-installer that downloads the apps from the internet and installs them. Once complete, when the app starts for the first time it will ask for authentication to activate.
-
@DBCountMan Thanks for the clarification! I see your point. Your option is quite more straight forward. The benefits left for using ODT are the lower bandwidth use (with our 100 Mbit internet) and configuration options.
It’s great that there are multiple options! -
I had to make a correction. I meant to say pre-1Gbit internet not 10Gbit internet. We have 10G backbones (intranet) but not to the internet.