Skip to content

Instantly share code, notes, and snippets.

# cat /root/service.sh
################################################################
#!/bin/bash
###edit the following
service=searchd
email=XXXXX@XXXXXX.com
###stop editing
host=`hostname -f`
Connect-MsolService
##############################################################
Get LastPasswordChangeTimestamp for all the users:
Get-MsolUser -All| select UserPrincipalName, LastPasswordChangeTimestamp|Export-Csv D:\user.csv
#####################################################################
Bulk reset Password and ForceChangePassword:
Import-Csv C:\users.csv | ForEach-Object { Set-MsolUserPassword -UserPrincipalName $_.UserPrincipalName -NewPassword $_.Newpassword -ForceChangePassword $true}
#####################################################################
#!/bin/bash
#
# tc-bandwidth-limit Limits the bandwidth of the configured interface
# chkconfig: 345 95 05
#
# description: Limits the bandwidth of the configured interface
### BEGIN INIT INFO
# Provides: tc-bandwidth-limit
# Default-Start: 3 4 5