< Back

Enable-AzureVMAutoShutdown

Tue Jan 14, 2020 12:36 am

NAME Enable-AzureVMAutoShutdown



SYNOPSIS

Enable Auto-Shutdown on Azure Virtual Machines





SYNTAX

Enable-AzureVMAutoShutdown [-time <Object>] [-timezone <Object>] [<CommonParameters>]



Enable-AzureVMAutoShutdown [-rgName <Object>] [-vmName <Object>] [-time <Object>] [-timezone <Object>]

-WebHookNoticationURI <Object> [<CommonParameters>]



Enable-AzureVMAutoShutdown [-rgName <Object>] [-vmName <Object>] [-time <Object>] [-timezone <Object>]

-emailfornotification <Object> [<CommonParameters>]



Enable-AzureVMAutoShutdown -rgName <Object> [-vmName <Object>] [-time <Object>] [-timezone <Object>]

[<CommonParameters>]





DESCRIPTION

This cmdlet will enable Azure Dev Test Labs Auto-Shutdown on Azure Virtual Machine or Machines.





PARAMETERS

-rgName <Object>

The Resource Group the virtual machine belongs to.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-vmName <Object>

The name of the virtual machine you want to add auto-shutdown too.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-time <Object>

Time to shutdown virtual machine, in military time. Default: 1600.



Required? false

Position? named

Default value 1600

Accept pipeline input? false

Accept wildcard characters? false



-timezone <Object>

Timezone for the the time. Default: Pacific Standard Time.



Required? false

Position? named

Default value Pacific Standard Time

Accept pipeline input? false

Accept wildcard characters? false



-emailfornotification <Object>

Email address to be notified before auto-shutdown, this is the default notification option is not is selected.

Azure user ID will be used if no email is specified.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WebHookNoticationURI <Object>

Incoming WebHook to send notification to before auto-shutdown.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Author : Hannel Hazeley - hhazeley@outlook.com



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Enable-AzureVMAutoShutdown -rgName DDemo -vmName DDemo-VM5



Enable auto shutdown for 4pm PST with email notification to user that is logged in to Azure environment









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Enable-AzureVMAutoShutdown -rgName DDemo -vmName DDemo-VM5 -time 1800 -timezone 'Eastern Standard Time'

-emailfornotification hhazeley@outlook.com



Enable auto shutdown for 6pm EST with email notification to hhazeley@outloook.com









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>$webhook = "https://outlook.office.com/webhook/b258 ... 6-5cbe5fd5...............



Enable-AzureVMAutoShutdown -rgName DDemo -vmName DDemo-VM5 -time 1900 -timezone 'Eastern Standard Time'

-WebHookNoticationURI $webhook



Enable auto shutdown for 7pm EST with webhook notification











RELATED LINKS

https://github.com/hhazeley/HannelsTool ... utdown.ps1