List of Useful commands

82 views
Skip to first unread message

Alex Bernal

unread,
Feb 1, 2024, 9:14:48 AMFeb 1
to munki-discuss
Hey Everyone, complete newbie to Munki here with a basic question. 

We are migrating our Macs from Mosyle to Intune. When we off-boarded them from Mosyle, all the Mosyle profiles were removed, including the one that configures the SoftwareRepoURL value in MSC. The result is MSC is now using the default URL.

After reading through the docs, I found a section on how to create the plist file that contains these settings, but I need to update it. Is there a way to alter the SoftwareRepoURL displayed in the output below without a complete reinstall?

sudo managedsoftwareupdate --show-config | grep URL

CatalogURL:  None [not set]
ClientResourceURL:  None [not set]
HelpURL:  None [not set]
IconURL:  None [not set]
ManifestURL:  None [not set]
PackageURL:  None [not set]
SoftwareRepoURL: 'http://munki/repo' [/Library/Preferences/ManagedInstalls.plist]
SoftwareUpdateServerURL:  None [not set]

Alex Bernal

unread,
Feb 1, 2024, 9:16:33 AMFeb 1
to munki-discuss
I forgot to ask: is there a list of useful commands I might use as a reference? I know the docs list them all, but I don't know which are important/useful for beginners. 

Alan

unread,
Feb 1, 2024, 10:02:49 AMFeb 1
to munki-...@googlegroups.com
I'd recommend using a profile from InTune to manage the SoftwareRepoURL, similarly to how you had Mosyle manage that setting.

You can manually set the preference via script:
/usr/bin/defaults write /Library/Preferences/ManagedInstalls SoftwareRepoURL "https://yourmunkirepourl/subdirectory"

But that can be easily changed. Better to manage it via a profile.

In terms of useful commands, I'd recommend at least these three:

But I'd start with following https://github.com/munki/munki/wiki/Demonstration-Setup to learn more about Munki

--
You received this message because you are subscribed to the Google Groups "munki-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/munki-discuss/7cf505cf-9118-483b-9fb3-8c6c1793e889n%40googlegroups.com.

Kevin M. Cox

unread,
Feb 1, 2024, 10:34:58 AMFeb 1
to munki-...@googlegroups.com
Definitely use a profile from Intune as Alan suggested for the long-term.

However what we did for our MDM migration was use a Munki NoPkg to write our preferences to disk so that Munki would continue working while the computer was "in limbo" between MDMs.

This would a managed_install on all computers before the migration and could then be a managed_uninstall after to clean things up.

-- Kevin


Alex Bernal

unread,
Feb 2, 2024, 3:21:35 PMFeb 2
to munki-discuss
Thanks for the suggestion!

I tried setting the preference manually in terminal using the command  /usr/bin/defaults write /Library/Preferences/ManagedInstalls SoftwareRepoURL "https://yourmunkirepourl/subdirectorybut got an error message: "Could not write domain /Library/Preferences/ManagedInstalls; existing"

Which is what I was wondering about in my initial post. It seems that is the command to set the preference the very forst time, but not for updating it. I also tried the command while logged in as Admin, same result.

Alex Bernal

unread,
Feb 2, 2024, 3:22:46 PMFeb 2
to munki-discuss
Kevin, we are using a Shell Script defined in Intune for this, it's just my PC is having enrollment issues, so I want to fix MSC so I can at least get updates again.

Alex Bernal

unread,
Feb 2, 2024, 3:56:58 PMFeb 2
to munki-discuss
Finally figured it out... The  /usr/bin/defaults write command needs to be run with sudo from within the admin account. 

I think I'm too used to windows; once logged in as Admin, I have full permission; I don't need to elevate again (sudo).

Thanks for the help guys!

Alan

unread,
Feb 2, 2024, 4:06:58 PMFeb 2
to munki-...@googlegroups.com
Most management tools will run scripts as root, so you wouldn't put sudo in the script.

But if you're just running it manually in a terminal, you might use sudo

Reply all
Reply to author
Forward
0 new messages