Friday 13 November 2020

ignore macOS update

 sudo softwareupdate --ignore 'macOS Big Sur'

Note: on catalina if mac is not in DEP, this will only ignore OS updates but not OS upgrade and this command is depreciated in Big Sur

sudo softwareupdate --ignore 'macOS Big Sur'
defaults delete com.apple.systempreferences AttentionPrefBundleIDs
defaults delete com.apple.systempreferences DidShowPrefBundleIDs
defaults write com.apple.preferences.softwareupdate LatestMajorOSSeenByUserBundleIdentifier com.apple.InstallAssistant.Catalina
defaults write com.apple.preferences.softwareupdate ProductKeysLastSeenByUser 061-21551
killall Dock

Ref:
https://forums.macrumors.com/threads/system-preferences-software-update-badge.2204123/page-2

Above method does not work 

The following works

add mac to MDM or set up a macOS server and enable profile manager, then install profile on targeted mac, Once profile installed, use following in terminal

softwareupdate --ignore "macOS Big Sur"


to verify if mac is enrolled in MDM or DEP USE FOLLOWING command


profiles status -type enrollment





Remove system update notification icon in macOS

Remove system update notification icon in macOS


defaults delete com.apple.systempreferences AttentionPrefBundleIDs; killall Dock 

Monday 28 September 2020

Useful powershell commands

Get current logon username on remote client  

Get-WMIObject -ComputerName clientname -class Win32_ComputerSystem | select username


Get user account lockout status

Get-ADUser username -Properties * | Select-Object LockedOut

Find user's groups with certain string

([Security.Principal.WindowsIdentity]("username")).Groups | foreach-object {$_.Translate([Security.Principal.NTAccount])} |  findstr /i 'test'

Find user's groups in AD

([Security.Principal.WindowsIdentity]("username")).Groups | foreach-object {$_.Translate([Security.Principal.NTAccount])}


Count file number

(Get-ChildItem -Recurse -File | Measure-Object).Count

Count directory number

(Get-ChildItem -Recurse -Directory | Measure-Object).Count


Get group member accounts (filtered by enabled) from certain group/groups 

 Get-ADGroup -Filter {name -like "some name strings"} | Get-adgroupmember -recursive | foreach-object {get-aduser -filter { (name -like $_.name)} -properties enabled } | where-object {$_.enabled -eq $false} | measure


Remove a package

Get-AppxPackage Microsoft.windowscommunicationsapps | Remove-AppxPackage


Get installed packages 

Get-CimInstance -computername pc01 win32_product | Select-Object Name, PackageName, InstallDate | Out-GridView

Thursday 11 June 2020

Change default env on macOS after Anadaconda installation

installed anadaconda and it changed default env to (base) , the new terminal will start with base env

in order to change it back, do the following

conda config --show | grep auto_activate_base

auto_activate_base: True

conda config --set auto_activate_base False
source ~/.bashrc
conda config --show | grep auto_activate_base

auto_activate_base: False

Friday 24 April 2020

Change registry value with command

overwrite windows update server

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v UseWUServer /t Reg_DWord /d 0

Optional: set windows AutoUpdate to disable

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAutoUpdate/t Reg_DWord /d 0

Wednesday 8 April 2020

get ad security groups applied to an AD user

$id = [Security.Principal.WindowsIdentity]("username")
$groups = $id.Groups | foreach-object {$_.Translate([Security.Principal.NTAccount])}
$groups | select *

to find specific group:

$id = [Security.Principal.WindowsIdentity]("username")
$groups = $id.Groups | foreach-object {$_.Translate([Security.Principal.NTAccount])}
$groups | findstr /i "vpn"


to find members of a particular group in AD
Get-adgroupmember -identity "domain admins" -Recursive | Select-Object name, objectclass

Saturday 21 March 2020

create bootable iso with oscdimg

  1. Copy all the installation file at one place, For Example “D:\windows_install” <path_of_installation_source> .
  2. Specify where you’ll create your ISO and its name, For Example “D:\WIN10.iso”
  3. Run the command line “Deployment and Imaging Tools Environment” as “Administrator”
  4. Use the following command line to create  your ISO
    OSCDIMG.exe -l<disk_label> [options] -b<path_of_etfsboot.com_file> <path_of_installation_source> <path_of_ISO_is_to_be_created_with_filename>
  5. Options Used
  6. For Example: use th following command to create your ISO file
  7. OSCDIMG.exe -lWIN10_OS -m -u2 -bD:\windows_install\boot\etfsboot.com D:\windows_install D:\WIN10.iso


Friday 3 January 2020

userful user account shortcuts

Windows cached credentials Editor

rundll32.exe keymgr.dll, KRShowKeyMgr 

Windows logged on user account

Control Userpasswords2

Windows Local Profile Editor

rundll32 sysdm.cpl,EditUserProfiles