User blog: Craig Blair

Craig Blair
by Craig Blair - Wednesday, 12 November 2025, 10:26 AM
Anyone in the world

Retiring Vids

[ Modified: Wednesday, 12 November 2025, 10:27 AM ]

Comments

     
    Craig Blair
    by Craig Blair - Wednesday, 5 November 2025, 11:11 AM
    Anyone in the world

    The Lair photos for repair

    [ Modified: Wednesday, 5 November 2025, 12:51 PM ]

    Comments

       
      Craig Blair
      by Craig Blair - Friday, 24 October 2025, 12:04 PM
      Anyone in the world

      These are the podcasts from students... enjoy...

      Comments

         
        Craig Blair
        by Craig Blair - Friday, 5 September 2025, 10:59 AM
        Anyone in the world

        1) Create the reset script

        Open Terminal and run:

        sudo mkdir -p /usr/local/bin
        cat <<'EOF' | sudo tee /usr/local/bin/office-reset.sh >/dev/null
        #!/bin/bash
        # Reset Microsoft Office activation & cached identities for the current user

        # Quit Office apps
        /usr/bin/pkill -f "Microsoft"

        # Remove cached Office data
        /bin/rm -rf "$HOME/Library/Group Containers/UBF8T346G9.Office/"*
        /bin/rm -rf "$HOME/Library/Containers/com.microsoft."*

        # Clean Keychain tokens (ignore errors if not present)
        /usr/bin/security delete-generic-password -l "Microsoft Office Identities Cache 2" "$HOME/Library/Keychains/login.keychain-db" 2>/dev/null
        /usr/bin/security delete-generic-password -l "Microsoft Office Identities Settings 2" "$HOME/Library/Keychains/login.keychain-db" 2>/dev/null
        /usr/bin/security delete-generic-password -s "ADAL" "$HOME/Library/Keychains/login.keychain-db" 2>/dev/null
        /usr/bin/security delete-generic-password -s "MSOID" "$HOME/Library/Keychains/login.keychain-db" 2>/dev/null

        # Nice-to-have: clear app saved state so Word doesn't re-open old windows
        /bin/rm -rf "$HOME/Library/Saved Application State/com.microsoft."*.savedState

        exit 0
        EOF
        sudo chmod 755 /usr/local/bin/office-reset.sh

        2) Make it run at every login (LaunchAgent)

        cat <<'EOF' | sudo tee /Library/LaunchAgents/au.nlsc.office.reset.plist >/dev/null
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
          <dict>
            <key>Label</key><string>au.nlsc.office.reset</string>
            <key>ProgramArguments</key>
            <array>
              <string>/usr/local/bin/office-reset.sh</string>
            </array>
            <key>RunAtLoad</key><true/>
            <key>StandardOutPath</key><string>/tmp/office-reset.out</string>
            <key>StandardErrorPath</key><string>/tmp/office-reset.err</string>
          </dict>
        </plist>
        EOF
        sudo chown root:wheel /Library/LaunchAgents/au.nlsc.office.reset.plist
        sudo chmod 644 /Library/LaunchAgents/au.nlsc.office.reset.plist

        Now log out and back in

        ************************-------------------**************************

        1) Install the reset script (once, system-wide)

        Open Terminal and run:

        sudo mkdir -p /usr/local/bin
        cat <<'EOF' | sudo tee /usr/local/bin/office-reset.sh >/dev/null
        #!/bin/bash
        # Reset Microsoft Office activation & cached identities for the current user

        # Quit Office apps
        /usr/bin/pkill -f "Microsoft"

        # Remove cached Office data
        /bin/rm -rf "$HOME/Library/Group Containers/UBF8T346G9.Office/"*
        /bin/rm -rf "$HOME/Library/Containers/com.microsoft."*

        # Clean Keychain tokens (ignore errors if not present)
        /usr/bin/security delete-generic-password -l "Microsoft Office Identities Cache 2" "$HOME/Library/Keychains/login.keychain-db" 2>/dev/null
        /usr/bin/security delete-generic-password -l "Microsoft Office Identities Settings 2" "$HOME/Library/Keychains/login.keychain-db" 2>/dev/null
        /usr/bin/security delete-generic-password -s "ADAL" "$HOME/Library/Keychains/login.keychain-db" 2>/dev/null
        /usr/bin/security delete-generic-password -s "MSOID" "$HOME/Library/Keychains/login.keychain-db" 2>/dev/null

        # Clear app saved state so Word/Excel don’t reopen windows
        /bin/rm -rf "$HOME/Library/Saved Application State/com.microsoft."*.savedState

        exit 0
        EOF
        sudo chmod 755 /usr/local/bin/office-reset.sh

        2) Create the LaunchAgent (system-wide, runs for all users)

        cat <<'EOF' | sudo tee /Library/LaunchAgents/au.nlsc.office.reset.plist >/dev/null
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
          <dict>
            <key>Label</key><string>au.nlsc.office.reset</string>
            <key>ProgramArguments</key>
            <array>
              <string>/usr/local/bin/office-reset.sh</string>
            </array>
            <key>RunAtLoad</key><true/>
            <key>StandardOutPath</key><string>/tmp/office-reset.out</string>
            <key>StandardErrorPath</key><string>/tmp/office-reset.err</string>
          </dict>
        </plist>
        EOF
        sudo chown root:wheel /Library/LaunchAgents/au.nlsc.office.reset.plist
        sudo chmod 644 /Library/LaunchAgents/au.nlsc.office.reset.plist

        ***************************-------------------*****************************

        pkill "Microsoft" && rm -rf ~/Library/Group\ Containers/UBF8T346G9.Office/* ~/Library/Containers/com.microsoft.* && security delete-generic-password -l "Microsoft Office Identities Cache 2" ~/Library/Keychains/login.keychain-db 2>/dev/null && security delete-generic-password -l "Microsoft Office Identities Settings 2"~/Library/Keychains/login.keychain-db 2>/dev/null && security delete-generic-password -s "ADAL"~/Library/Keychains/login.keychain-db 2>/dev/null && security delete-generic-password -s "MSOID"~/Library/Keychains/login.keychain-db 2>/dev/null

        *********************************-------------------************************************

        rm -rf ~/Library/Group\ Containers/UBF8T346G9.Office/*

        rm -rf ~/Library/Containers/com.microsoft.Word

        rm -rf ~/Library/Containers/com.microsoft.Excel

        rm -rf ~/Library/Containers/com.microsoft.Powerpoint

        rm -rf ~/Library/Containers/com.microsoft.onenote.mac

        *********************************-------------------************************************

        Comments

           
          Craig Blair
          by Craig Blair - Thursday, 28 August 2025, 11:45 AM
          Anyone in the world

          Flashcards

          [ Modified: Friday, 29 August 2025, 9:07 AM ]

          Comments

             
            Craig Blair
            by Craig Blair - Monday, 21 July 2025, 3:12 PM
            Anyone in the world

            LED ISSUES - 21-07-2025

            [ Modified: Monday, 21 July 2025, 3:12 PM ]

            Comments

               
              Craig Blair
              by Craig Blair - Tuesday, 3 June 2025, 2:10 PM
              Anyone in the world

              VLC

              Comments

                 
                Craig Blair
                by Craig Blair - Tuesday, 8 April 2025, 10:26 AM
                Anyone in the world

                Staff Docs

                [ Modified: Tuesday, 8 April 2025, 10:36 AM ]

                Comments

                   
                  Craig Blair
                  by Craig Blair - Monday, 31 March 2025, 12:20 PM
                  Anyone in the world

                  LibreOffice

                  Comments

                     
                    Craig Blair
                    by Craig Blair - Friday, 28 March 2025, 10:41 AM
                    Anyone in the world

                    LinuxMintStrip

                    [ Modified: Friday, 15 August 2025, 1:25 PM ]

                    Comments