full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/activedirectory/ad-rep.ps1
ad-rep.ps1
# on se place dans le repertoire contenant les scripts et les fichiers de donnees $script_location = Split-Path $MyInvocation.MyCommand.Path # on lit le chemin + nom de fichier du script et on le split pour ne garder que le chemin Set-Location -Path $script_location # on se ...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/hyperv/base.ps1
base.ps1
cd C:\ $hypervPath = "C:\hyperv\" If (-not (Test-Path $hypervPath)) { md $hypervPath } $basePath = "C:\hyperv\base\" If (-not (Test-Path $Path)) { md $hypervPath } $webClient = New-Object System.Net.WebClient $vhdFile = "9600.16415.amd64fre.winblue_refresh.130928-2229_server_serverdatacentereval_en-us.vhd" $remo...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/hyperv/create-vm.ps1
create-vm.ps1
# Les disques durs doivent être crées au préalable au format VHDX # Le Chemin des Disques est en dur dans la commande $VMName = Read-Host "Nom de la VM" [Int]$NICs = Read-Host "Nombre de NICs" [Int]$RAM = Read-Host "RAM (en Mo)" [Int]$VMRAM = ($RAM * 1MB) $VMPath = "D:\Hyper-V\VHDs\$VMName.vhdx" New-...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/hyperv/install.ps1
install.ps1
Install-WindowsFeature –Name Hyper-V -IncludeManagementTools -Restart
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/userinterface/gui_off.ps1
gui_off.ps1
#supprimer l’interface graphique sur 2012R2 Import-Module ServerManager Remove-WindowsFeature Server-Gui-Shell Shutdown /r /t 0
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/userinterface/gui_on.ps1
gui_on.ps1
#ajouter l’interface graphique sur 2012R2 Import-Module ServerManager Add-WindowsFeature Server-Gui-Shell Shutdown /r /t 0
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/rtr/srv-03.ps1
srv-03.ps1
# Creer VHDx de Diff, creer VM avec trois cartes réseau # Suite specialisation - Renommer Windows Rename-Computer -NewName SRV-03 netsh int ipv4 set address "Ethernet" source=static 10.62.1.16/24 # Ajout de la route vers BOULOGNE et route par defaut route add -p 0.0.0.0/0 10.62.1.1 # Autoriser le ping...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/rtr/rtr-O1.ps1
rtr-O1.ps1
# Creer VHDx de Diff, creer VM avec trois cartes réseau # Suite specialisation - Renommer Windows Rename-Computer -NewName RTR-01 # Identifier les cartes en les branchant une a une puis les nommer Rename-NetAdapter -Name "Ethernet" -NewName "CLI" Rename-NetAdapter -Name "Ethernet 2" -NewName "WAN" Rename-...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/rtr/srv-02.ps1
srv-02.ps1
# Creer VHDx de Diff, creer VM avec trois cartes réseau # Suite specialisation - Renommer Windows Rename-Computer -NewName SRV-02 netsh int ipv4 set address "Ethernet" source=static 10.59.0.17/24 # Ajout de la route vers BOULOGNE et route par defaut route add -p 0.0.0.0/0 10.59.0.1 # Autoriser le ping...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/rtr/srv-01.ps1
srv-01.ps1
# Creer VHDx de Diff, creer VM avec trois cartes réseau # Suite specialisation - Renommer Windows Rename-Computer -NewName SRV-01 netsh int ipv4 set address "Ethernet" source=static 10.59.0.16/24 # Ajout de la route vers BOULOGNE et route par defaut route add -p 0.0.0.0/0 10.59.0.1 # Autoriser le ping...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/rtr/rtr-02.ps1
rtr-02.ps1
# Attention les cartes doivent etres nommees AVANT # Suite specialisation - Renommer Windows Rename-Computer -NewName RTR-02 # Identifier les cartes en les branchant une a une puis les nommer Rename-NetAdapter -Name "Ethernet" -NewName "Boulogne" Rename-NetAdapter -Name "Ethernet 2" -NewName "WAN" netsh...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/rtr/rtr-03.ps1
rtr-03.ps1
# Attention les cartes doivent etres nommees AVANT # Suite specialisation - Renommer Windows Rename-Computer -NewName RTR-03 # Identifier les cartes en les branchant une a une puis les nommer Rename-NetAdapter -Name "Ethernet" -NewName "Salle" Rename-NetAdapter -Name "Ethernet 2" -NewName "WAN" netsh in...
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_NewRepo_2017_5_20_22_58_30/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstorageprod.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source url: ...
PowerShellCorpus/Github/vmkdaily_New-CisVMPractice/New-CisVMPractice.ps1
New-CisVMPractice.ps1
#Requires -Version 3 Function New-CisVMPractice { <# .SYNOPSIS Connects to vCenter 6.5 and creates a Virtual Machine using the vSphere Automation SDK API. .DESCRIPTION Connects to vCenter 6.5 and creates a Virtual Machine using the vSphere Automation SDK API. The VM is built with no hard disk or network ad...
PowerShellCorpus/Github/aki426_SICPjpHtmlToMobi/convertToMobi.ps1
convertToMobi.ps1
clear Remove-Item .\x010.html Remove-Item .\x020.html #Remove-Item .\test.html #xcont.htmlには全行適用 #その他はナビゲータのみに適用 function Rewrite-PageLink ($line) { ###リンク関係 $line = $line -replace "xcont.html", "#ccont" #●目次 $line = $line -replace "xfore.html", "#sfore" #●序文 $line = $line -replace "x...
PowerShellCorpus/Github/DDLSTraining_ClassroomServices/Boxstarter.ps1
Boxstarter.ps1
Update-ExecutionPolicy -Policy Unrestricted Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions -EnableExpandToOpenFolder -EnableShowFullPathInTitleBar -EnableOpenFileExplorerToQuickAccess -EnableShowRecentFilesInQuickAccess -EnableShowFrequentFoldersInQuickAccess Set-StartScree...
PowerShellCorpus/Github/DDLSTraining_ClassroomServices/Scripts/GhostScan/Invoke-GhostScan.ps1
Invoke-GhostScan.ps1
# Change the list of paths below. $scanPaths = "S:\Checkpoint", "S:\Cisco", "S:\Comptia", "S:\Defence", "S:\ECCouncil", "S:\Lotus", "S:\Microsoft", "S:\VMWare" "Getting .gho Ghost file list..." $gho ...
PowerShellCorpus/Github/byuoitav_crestron-tec-hd/src/tools/simplplus/mass-usp-compiler/mass-usp-compiler.ps1
mass-usp-compiler.ps1
param ( [Parameter(Mandatory=$true)] [string]$Path, [switch]$series2, [switch]$series3 ) $Source = Split-Path -Path $PSScriptRoot -Parent $FolderPath = Split-Path -Path $Source -Parent $FileExtension = ".usp" $Dir = get-childitem $Path -recurse $List = $Dir | where {$_.extension -eq $FileExt...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/Create Operational Collections.ps1
Create Operational Collections.ps1
############################################################################# # Author : Benoit Lecours # Website : www.SystemCenterDudes.com # Twitter : @scdudes # Version : 1.0 # Created : 2014/07/17 # Modified : 2014/08/14 # - Added Collection 34,35,36 #Updated by : eswar Koneti (www.eskonr.com)...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/get-registry-hives.ps1
get-registry-hives.ps1
$data = Get-ChildItem -path ` registry::'hklm\software\microsoft\windows\currentversion\installer\userdata\s-1-5-18\components' ` -Recurse | Where-Object -FilterScript {$_.Name -like '*\19BF4688EE4961F41A44D0282A2340D9' } foreach( $d in $data ) { $d.Name >> hive.txt }
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/DeleteSSRSReports.ps1
DeleteSSRSReports.ps1
<# .SYNOPSIS Uninstalls an RDL file from SQL Reporting Server using Web Service .DESCRIPTION Uninstalls an RDL file from SQL Reporting Server using Web Service .NOTES File Name: Uninstall-SSRSRDL.ps1 Author: Randy Aldrich Paulo Prerequisite: SSRS 2008, Powershell 2.0 .EXAMPLE Uninstall-SSRSRDL -we...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/Delete_Computers_From_Collection.ps1
Delete_Computers_From_Collection.ps1
#Title:Delete computer records from specific collection . #Author:Eswar Koneti #dated:19-Sep-2014 #Contact via: www.eskonr.com param( [String[]] $Collections ) foreach ($CollectionID in $Collections) { #*****************************common functions start here****************************************** #if ...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/Get Computer Info from AD.ps1
Get Computer Info from AD.ps1
Import-Module ActiveDirectory Get-Content C:\computers.txt | ForEach-Object {Get-ADComputer $_ -Properties Name,OperatingSystem,OperatingSystemServicePack |Select-Object Name,OperatingSystem,OperatingSystemServicePack} |-SearchBase "DC=KCL,DC=KEPPELGROUP,DC=COM" | Export-Csv C:\Output.csv
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/Count Files in Inbox Folders.ps1
Count Files in Inbox Folders.ps1
Get-ChildItem \\MYSERVER\SMS_C01\inboxes -Recurse | Group-Object Directory | Where { $_.Count -gt 1 } | Sort-Object Count -Descending | Format-Table Count, Name -AutoSize
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/search for string in registry.ps1
search for string in registry.ps1
Set-Location -Path HKLM: $ItemExists = $false $Reglist = (Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall).Name foreach ($item in $Reglist) { $key = Get-ItemProperty -Path $item | Select-Object -Property DisplayName if ($key.DisplayName -match 'pdf*' -and $key.DisplayName -ma...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/Import-ConfigMgrSQLReports.ps1
Import-ConfigMgrSQLReports.ps1
#requires -version 2 #======================================================================== # # Created on: 30/08/2012 # Created by: M Whittle # Organization: WAE, BNP Paribas # Filename: Import-ConfigMgrSQLReports.ps1 # Description: Imports SQL Reporting services reports into ConfigMgr # # Version:...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/list updates on SCCM Client.ps1
list updates on SCCM Client.ps1
$SUPS = (Get-WmiObject -Namespace "root\ccm\clientSDK" -Class CCM_SoftwareUpdate -ComputerName localhost) foreach ($SUP in $SUPS) { write-host "$($SUP.Name) Status $($SUP.EvaluationState)" }
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/Trigger client inventory action agents on remote computers.ps1
Trigger client inventory action agents on remote computers.ps1
$ScheduleID='{00000000-0000-0000-0000-000000000101}' #$computers =GC "C:\Users\SGKONETIE\Desktop\computers.txt" $Computer="SINW11078136" #foreach ($computer in $computers) { Invoke-WmiMethod -Namespace root\CCM -Class SMS_Client -Name TriggerSchedule -ArgumentList $ScheduleID -computername $computer }
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/List Apps on SCCM Client.ps1
List Apps on SCCM Client.ps1
$Apps = (Get-WmiObject -Namespace "root\ccm\clientSDK" -Class CCM_Application -ComputerName localhost) foreach ($App in $Apps) { write-host "$($App.Name) Status $($App.InstallState)" }
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/UploadSSRSReports.ps1
UploadSSRSReports.ps1
<# .SYNOPSIS Bulk import SSRS Reports from a folder and update the reports data source. .DESCRIPTION This script takes all the RDL files in a folder and imports them into a SSRS and updates the reports data source to the Configmgr shared data source. .NOTES File Name : Upload SSRS Reports.ps1 Ve...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/Delete Old log files with _SCNotify.ps1
Delete Old log files with _SCNotify.ps1
$Global:ErrorActionPreference = "SilentlyContinue" stop-Transcript | out-null Start-Transcript -path C:\Temp\Logs\CleanSCCMSCLogs.txt -append $startdate = Get-Date Get-ChildItem c:\windows\ccm\logs | Where-Object {$_.Name -like 'SCNotify*' -or $_.Name -like 'SCClient*' -or $_.Name -like '_SCNotify*' -or $_.Name -...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/Open CCM Folder logs.ps1
Open CCM Folder logs.ps1
$CompName=read-host "Enter the Computer Name to Open CCM logs" #test-connection "SINW11078136" $wshell = New-Object -ComObject Wscript.Shell if (Test-Connection $CompName -Count 1 -ea 0 -Quiet) { start "\\$CompName\C$\Windows\syswow64\ccm\logs\" } else { $wshell.Popup("Client is NOT up or cannot Comm...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/Refresh failed packages.ps1
Refresh failed packages.ps1
#if you are not running the script on your SCCM Server(SMS provider),you will have to provide the SCCM server name here. Replace Localhost with your SCCM server $SMSProvider = "sgkomtaccm01" $DPName="SGKFECYCCM01" Function Get-SiteCode { $wqlQuery = “SELECT * FROM SMS_ProviderLocation” $a = Ge...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/Get-DNSandWINS.ps1
Get-DNSandWINS.ps1
# Get-DNSandWINS.ps1 # Written by Bill Stewart (bstewart@iname.com) #requires -version 2 # Version history: # # 2.0 (2013-10-02) # * Added -Credential # * Output data only for IPv4 addresses # * Output separate row for each DNS server address # # 1.0 (2012-02-15) # * Initial version <# .SYNOPSIS Out...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/remove expired updates from SU group.ps1
remove expired updates from SU group.ps1
# ======================================================================================= # # Name: RemoveExpiredUpdates.ps1 # Author: Jeroen Erkelens #Modified by: Eswar Koneti # Version: 0.6 # Date: 16-Sep-2015 # Goal: Enumerate all Software Update groups. For CM2012 R2, WSUS cleanup will remove the # ...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/Resync-compliance-State.ps1
Resync-compliance-State.ps1
##### Name: Resync the compliance state ##### Ref Article:http://blogs.technet.com/b/scotts-it-blog/archive/2015/02/23/refreshing-state-messages-in-system-center-configuration-manager-2012.aspx $SCCMUpdatesStore = New-Object -ComObject Microsoft.CCM.UpdatesStore $SCCMUpdatesStore.RefreshServerComplianceState() Ne...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Powershell/Delete_SCCM_Client_Cache_Content.ps1
Delete_SCCM_Client_Cache_Content.ps1
#Connect to Resource Manager COM Object $CMObject = new-object -com "UIResource.UIResourceMgr" $cacheInfo = $CMObject.GetCacheInfo() #Enum Cache elements, compare date, and delete older than 2 days $objects=$cacheinfo.GetCacheElements() | where-object {$_.LastReferenceTime -lt (get-date).AddDays(-2)} | foreach ...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Tools/CleanSoftwareUpdateGroups/Invoke-ToolInstallation.ps1
Invoke-ToolInstallation.ps1
<# .Synopsis Installs or uninstalls the Clean Software Update Groups console extension for ConfigMgr. .DESCRIPTION Configures settings for and installs a console extension to remove expired and superseded updates from software update groups in ConfigMgr. .PARAMETER SiteServer Specifies the name of t...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Tools/CleanSoftwareUpdateGroups/Clean-CMSoftwareUpdateGroups.ps1
Clean-CMSoftwareUpdateGroups.ps1
<# .SYNOPSIS Perform a clean up of expired and/or supersded Software Updates in all Software Update Groups .DESCRIPTION Use this script if you need to perform a clean up of expired and/or superseded Software Updates from all Software Upgrade Groups in ConfigMgr .PARAMETER SiteServer Site server name w...
PowerShellCorpus/Github/eskonr_Configmgr-Kit/Tools/Cleanup WSUS Database on Schedule basis/WSUSCleanupTask.ps1
WSUSCleanupTask.ps1
Add-Type -Path "C:\Program Files\Update Services\API\Microsoft.UpdateServices.Administration.dll" $UseSSL = $False $PortNumber = 8530 $Server = "VSGRHOWPSCM02" $ReportLocation = "D:\Sources\Tools\WSUS\WSUS_CleanUpTaskReport.html" $SMTPServer = "smtp.eskonr.com" $SMTPPort = 25 $To = "Eswar Koneti <e...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_08/Queue_Reporting.ps1
Queue_Reporting.ps1
$BodyStyle = "<style>" $BodyStyle = $BodyStyle + "BODY{background-color:peachpuff;}" $BodyStyle = $BodyStyle + "TABLE{border-width: 1px;border-style: solid; border-color: black;border-collapse: collapse;}" $BodyStyle = $BodyStyle + "TH{border-width: 1px;padding: 0px; border-style: solid;border-color: black;backgrou...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_08/WorkLoadManagementPolicy.ps1
WorkLoadManagementPolicy.ps1
New-WorkloadManagementPolicy NewYorkWorkloadManagementPolicy New-WorkloadPolicy -Name NewYorkPOP3WorkloadPolicy -WorkloadType POP -WorkloadClassification Discretionary -WorkloadManagementPolicy NewYorkWorkloadManagementPolicy Get-ExchangeServer -Identity NYC-EXCH01 | Set-ExchangeServer -WorkloadManagementPolicy N...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_08/Throttling_Policy.ps1
Throttling_Policy.ps1
New-ThrottlingPolicy -Name ITStaffPowerShell -PowerShellMaxDestructiveCmdlets 10 -PowerShellMaxDestructiveCmdletsTimePeriod 60 -PowerShellMaxConcurrency 6 -PowerShellMaxCmdletQueueDepth 12 -ThrottlingPolicyScope Regular Get-Mailbox -Identity Beau | Set-Mailbox -ThrottlingPolicy ITStaffPowerShell
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_03/Install-Prereq-2008R2-MultiRoleServer.ps1
Install-Prereq-2008R2-MultiRoleServer.ps1
Import-Module ServerManager Add-WindowsFeature Desktop-Experience, NET-Framework, NET-HTTP-Activation, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Web-Server, WAS-Process-Model, Web-Asp-Net, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_03/New-EdgeSubscription-MBX.ps1
New-EdgeSubscription-MBX.ps1
New-EdgeSubscription -FileData ([byte[]]$(Get-Content -Path "C:\Temp\edge01.xml" -Encoding Byte -ReadCount 0)) -Site "Default-First-Site-Name" -CreateInternetSendConnector $true -CreateInboundSendConnector $true Start-EdgeSynchronization
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_03/New-EdgeSubscription-Edge.ps1
New-EdgeSubscription-Edge.ps1
New-EdgeSubscription -FileName C:\Temp\Edge01.xml
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_03/Install-Prereq-2008R2-ClientAccessServer.ps1
Install-Prereq-2008R2-ClientAccessServer.ps1
Import-Module ServerManager Add-WindowsFeature Desktop-Experience, NET-Framework, NET-HTTP-Activation, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Web-Server, WAS-Process-Model, Web-Asp-Net, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_03/Set-Vdir-2007-2013.ps1
Set-Vdir-2007-2013.ps1
Set-OWAVirtualDirectory -Identity van-cas2013\owa* -InternalURL https://webmail.contoso.com/owa -ExternalURL https://webmail.contoso.com/owa Set-ECPVirtualDirectory -Identity van-cas2013\ecp* -InternalURL https://webmail.contoso.com/ecp -ExternalURL https://webmail.contoso.com/ecp Set-ActiveSyncVirtualDirectory -...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_03/Install-Prereq-2012-ClientAccessServer.ps1
Install-Prereq-2012-ClientAccessServer.ps1
Install-WindowsFeature RSAT-ADDS Install-WindowsFeature AS-HTTP-Activation, Desktop-Experience, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_03/Install-Prereq-2012-MultiRoleServer.ps1
Install-Prereq-2012-MultiRoleServer.ps1
Install WindowsFeature RSAT-ADDS Install-WindowsFeature AS-HTTP-Activation, Desktop-Experience, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dy...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_03/Set-Vdir-2010-2013.ps1
Set-Vdir-2010-2013.ps1
Set-OWAVirtualDirectory -Identity eml-cas2013\owa* -InternalURL https://webmail.contoso.com/owa -ExternalURL https://webmail.contoso.com/owa Set-ECPVirtualDirectory -Identity eml-cas2013\ecp* -InternalURL https://webmail.contoso.com/ecp -ExternalURL https://webmail.contoso.com/ecp Set-ActiveSyncVirtualDirectory -...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_04/Get-ClientAccessServer.ps1
Get-ClientAccessServer.ps1
Get-ClientAccessServer -Identity AMS-EXCH01 | Set-ClientAccessServer -AutoDiscoverServiceInternalUri https://autodiscover.contoso.com/autodiscover/autodiscover.xml Get-ClientAccessServer | Set-ClientAccessServer -AutoDiscoverServiceInternalUri https://autodiscover.contoso.com/autodiscover/autodiscover.xml
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_04/Set-OutlookAnywhere.ps1
Set-OutlookAnywhere.ps1
Set-OutlookAnywhere -Server AMS-EXCH01 -ExternalHostname webmail.contoso.com -ExternalClientsRequireSsl:$true –InternalHostname webmail.contoso.com –InternalClientsRequireSsl:$true
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_04/New-SendConnector.ps1
New-SendConnector.ps1
New-SendConnector -Name " Send Connector" -Internet -AddressSpaces "*" -DNSRoutingEnabled:$TRUE -SourceTransportServers "2012E15BE01","2012E15BE02" -FrontendProxyEnabled:$TRUE
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_04/Set-VirtualDirectories.ps1
Set-VirtualDirectories.ps1
Set-OWAVirtualDirectory -Identity AMS-EXCH01 -ExternalURL https://webmail.contosol.com/owa -InternalURL https://webmail.contoso.com/owa Set-OWAVirtualDirectory -Identity AMS-EXCH01 -ExternalURL https://webmail.contosol.com/owa -InternalURL https://webmail.contoso.com/owa Set-ECPVirtualDirectory -ExternalURL https...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_02/Import-SSL-Certificate.ps1
Import-SSL-Certificate.ps1
Import-ExchangeCertificate ľServer AMS-EXCH01 -FileData ([Byte[]]$(Get-Content -Path "\\ams-ad01\MgmtShare\webmail_contoso_com.pfx" -Encoding byte -ReadCount 0)) -Password:(Get-Credential).password | Enable-ExchangeCertificate -Server AMS-EXCH01 -Services IIS
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_02/Install-Prereq-2008R2-MultiRoleServer.ps1
Install-Prereq-2008R2-MultiRoleServer.ps1
Import-Module ServerManager Add-WindowsFeature Desktop-Experience, NET-Framework, NET-HTTP-Activation, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Web-Server, WAS-Process-Model, Web-Asp-Net, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_02/Get-ClientAccessServer.ps1
Get-ClientAccessServer.ps1
Get-ClientAccessServer -Identity AMS-E15SRV01 | Set-ClientAccessServer -AutoDiscoverServiceInternalUri https://autodiscover.contoso.com/autodiscover/autodiscover.xml
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_02/New-AcceptedDomain.ps1
New-AcceptedDomain.ps1
New-AcceptedDomain -Name Fabrikam -DomainName Fabrikam.com -DomainType Authoritative
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_02/Get-OutlookAnywhere.ps1
Get-OutlookAnywhere.ps1
Get-OutlookAnywhere -Server AMS-EXCH01 | Set-OutlookAnywhere -ExternalHostname webmail.contoso.com -ExternalClientsRequireSsl:$true
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_02/New-SendConnector.ps1
New-SendConnector.ps1
New-SendConnector -Name "Internet Send Connector" -Internet -AddressSpaces "*" -DNSRoutingEnabled:$TRUE -SourceTransportServers "AMS-EXCH01"
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_02/Check-Schema-Version.ps1
Check-Schema-Version.ps1
$root = [ADSI]"LDAP://RootDSE" $m = [ADSI]("LDAP://" + "CN=ms-Exch-Schema-Version-Pt," + $root.schemaNamingContext) $m.rangeUpper
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_02/Install-Prereq-2008R2-ClientAccessServer.ps1
Install-Prereq-2008R2-ClientAccessServer.ps1
Import-Module ServerManager Add-WindowsFeature Desktop-Experience, NET-Framework, NET-HTTP-Activation, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Web-Server, WAS-Process-Model, Web-Asp-Net, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_02/Change_vdir_settings.ps1
Change_vdir_settings.ps1
# Change_vdir_Settings.ps1 # You can use this small script to change the virtual directories on your exchange (2013) server # starting point is split DNS, so internalURL and externalURL are identical # # usage: .\Change_vdir_settings.ps1 contoso.com # $ServerName = $env:COMPUTERNAME $Domain = $args[0] $Serve...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_02/Install-Prereq-2012-ClientAccessServer.ps1
Install-Prereq-2012-ClientAccessServer.ps1
Install-WindowsFeature RSAT-ADDS Install-WindowsFeature AS-HTTP-Activation, Desktop-Experience, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_02/New-EmailAddressPolicy.ps1
New-EmailAddressPolicy.ps1
New-EmailAddressPolicy -Name Fabrikam -IncludedRecipients AllRecipients -RecipientContainer "contoso.com/accounts" -EnabledEmailAddressTemplates "SMTP:%l@fabrikam.com"
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_02/New-SSL-Certificate.ps1
New-SSL-Certificate.ps1
$Data = New-ExchangeCertificate -FriendlyName "Contoso SSL Certificate" -GenerateRequest -SubjectName "c=US, o=Contoso, cn=webmail.contoso.com" -DomainName webmail.contoso.com,autodiscover.contoso.com -PrivateKeyExportable $true Set-Content -path "\\ams-ad01\mgmtshare\SSLCertRequest.req" -Value $Data Import-Excha...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_02/Install-Prereq-2012-MultiRoleServer.ps1
Install-Prereq-2012-MultiRoleServer.ps1
Install WindowsFeature RSAT-ADDS Install-WindowsFeature AS-HTTP-Activation, Desktop-Experience, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dy...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_06/New-DynamicDistributionGroup.ps1
New-DynamicDistributionGroup.ps1
New-DynamicDistributionGroup -Name Publishers -DisplayName "Contoso Publishers" -IncludedRecipients AllRecipients -OrganizationalUnit contoso.com/accounts/contoso -ConditionalDepartment Publishing
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_06/Remote_PowerShell.ps1
Remote_PowerShell.ps1
$Session = New-PSSession –ConfigurationName Microsoft.Exchange –ConnectionUri https://ams-exch01.contoso.com/PowerShell -Authentication Kerberos Import-PSSession $Session
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_06/HTML-MailboxInfo-Send.ps1
HTML-MailboxInfo-Send.ps1
$Now=Get-Date $BodyStyle="<link rel='stylesheet' type='text/css' href= 'http://www.domain.com/styles/reporting.css' />" $BodyStyle=$BodyStyle + "<title>Exchange 2013 Mailbox Reporting</title>" $MBXOutput = Get-MailboxStatistics –Server ams-exch01 | ConvertTo-HTML DisplayName, ServerName, DatabaseName, ItemCount, Tot...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_06/HTML-MailboxInfo.ps1
HTML-MailboxInfo.ps1
$Now=Get-Date $BodyStyle="<link rel='stylesheet' type='text/css' href= 'http://www.domain.com/styles/reporting.css' />" $BodyStyle=$BodyStyle + "<title>Exchange 2013 Mailbox Reporting</title>" $MBXOutput = Get-MailboxStatistics –Server ams-exch01 | ConvertTo-HTML DisplayName, ServerName, DatabaseName, ItemCount, Tot...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_06/Address_Book_Policies.ps1
Address_Book_Policies.ps1
New-GlobalAddressList -Name "Fabrikam GAL" -RecipientFilter "((Alias -ne '`$NULL') -and (CustomAttribute1 -eq 'Fabrikam'))" New-AddressList -Name "Fabrikam All Users Address List" -Container "\" -DisplayName "Fabrikam All Users Address List" -RecipientFilter "((Alias -ne '`$NULL') -and (CustomAttribute1 -eq 'Fabrika...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_06/Set-MailboxRegionalConfiguration.ps1
Set-MailboxRegionalConfiguration.ps1
Set-MailboxRegionalConfiguration –Identity kimi -dateformat "d-M-yyyy" -timezone "W. Europe Standard Time" -timeformat "HH:mm" -Language "nl-NL" -LocalizeDefaultFolderName:$true
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_06/Bulk_users.ps1
Bulk_users.ps1
$Database="DB01" $UPN="FourthCoffee.com" $users = import-csv $args[0] function SecurePassword([string]$password) { $secure = New-Object System.Security.SecureString $password.ToCharArray() | % { $secure.AppendChar($_) } return $secure } ForEach ($user in $users) { $sp = SecurePassword $user.passwor...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_06/New-DistributionGroup.ps1
New-DistributionGroup.ps1
New-DistributionGroup -Name Support -DisplayName "Support Department" -OrganizationalUnit contoso.com/accounts/contoso -ManagedBy administrator, "john smith" -CopyOwnerToMember
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_06/New-MailUser.ps1
New-MailUser.ps1
New-MailUser -Name "John Smith" -Alias JSmith -OrganizationalUnit contoso.com/accounts/contoso -UserPrincipalName JSmith@contoso.com -FirstName John -Initials M -LastName Smith -DisplayName "John Smith" -Password (ConvertTo-SecureString 'Pass1word' -AsPlainText -Force) -ExternalEmailAddress "SMTP:JohnMSmith@hotmail.com...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_06/New-MailContact.ps1
New-MailContact.ps1
New-MailContact -Name "John Williams" -FirstName John -LastName Williams -DisplayName "John Williams" -OrganizationalUnit contoso.com/accounts/contoso -ExternalEmailAddress "SMTP:JohnWilliams@hotmail.com"
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_06/Remote_PowerShell_Basic.ps1
Remote_PowerShell_Basic.ps1
$Credential = Get-Credential $Session = New-PSSession –ConfigurationName Microsoft.Exchange –ConnectionUri https://webmail.contoso.com/PowerShell -Authentication Basic -Credential $Credential Import-PSSession $Session
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_05/Set-OrganizationConfig.ps1
Set-OrganizationConfig.ps1
Set-OrganizationConfig -DefaultPublicFolderIssueWarningQuota 1.9GB -DefaultPublicFolderProhibitPostQuota 2.3GB -DefaultPublicFolderMaxItemSize 200MB -DefaultPublicFolderDeletedItemRetention 30.00:00:00 -DefaultPublicFolderMovedItemRetention 30.00:00:00
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_05/New-PublicFolderMailbox.ps1
New-PublicFolderMailbox.ps1
New-Mailbox -PublicFolder -Name MasterHierarchy -OrganizationalUnit "contoso.com/accounts/service accounts" -Database DB01
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_05/New-EdgeSubscription-MBX.ps1
New-EdgeSubscription-MBX.ps1
New-EdgeSubscription -FileData ([byte[]]$(Get-Content -Path "C:\Temp\edge01.xml" -Encoding Byte -ReadCount 0)) -Site "Default-First-Site-Name" -CreateInternetSendConnector $true -CreateInboundSendConnector $true Start-EdgeSynchronization
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_05/Send-On-Behalf-Of.ps1
Send-On-Behalf-Of.ps1
Set-Mailbox -Identity Cindy -GrantSendOnBehalfTo John
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_05/New-EdgeSubscription-Edge.ps1
New-EdgeSubscription-Edge.ps1
New-EdgeSubscription -FileName C:\Temp\Edge01.xml
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_05/New-MailboxDatabase.ps1
New-MailboxDatabase.ps1
New-MailboxDatabase -Name DB03 -Server AMS-EXCH01 -EdbFilePath F:\DB03\DB03.edb -LogFolderPath F:\DB03\LogFiles Mount-Database -Identity DB03
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_05/New-PublicFolders.ps1
New-PublicFolders.ps1
New-PublicFolder -Name Contoso -Path \ -Mailbox MasterHierarchy New-PublicFolder -Name Marketing -Path \Contoso Enable-MailPublicFolder -Identity \Contoso\Marketing Add-PublicFolderClientPermission -Identity \Contoso\Marketing -User Marketing -AccessRights PublishingEditor
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_05/Send-As.ps1
Send-As.ps1
Add-ADPermission -Identity Cindy -User John -ExtendedRights "Send As"
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_05/New-DatabaseAvailabilityGroup.ps1
New-DatabaseAvailabilityGroup.ps1
New-DatabaseAvailabilityGroup -Name DAG01 -WitnessServer AMS-FS01.contoso.com -WitnessDirectory C:\DAG01\DAG01_FSW -DatabaseAvailabilityGroupIPAddresses 192.168.0.187 Add-DatabaseAvailabilityGroupServer -Identity DAG01 -MailboxServer AMS-EXCH01 Add-DatabaseAvailabilityGroupServer -Identity DAG01 -MailboxServer AM...
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_05/Full-Access.ps1
Full-Access.ps1
Add-MailboxPermission -Identity Cindy -User John -AccessRights FullAccess -InheritanceType all
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_05/Enable-CircularLogging.ps1
Enable-CircularLogging.ps1
Set-MailboxDatabase -Identity DB03 -CircularLoggingEnabled:$true Dismount-Database -Identity DB03 -Confirm:$false Mount-Database -Identity DB03
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_07/New-MailboxRestoreRequest-3.ps1
New-MailboxRestoreRequest-3.ps1
New-MailboxRestoreRequest -SourceDatabase "MDB01 Recovery" -SourceStoreMailbox Administrator -TargetMailbox legal -TargetRootFolder "Recovery Items"
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_07/New-RecoveryDatabase.ps1
New-RecoveryDatabase.ps1
New-MailboxDatabase -Name "MDB01 Recovery" -Recovery -Server EXCH01 -EdbFilePath G:\RestoreDB\F_\MDB01\MDB01.edb -LogFolderPath G:\RestoreDB\F_\MDB01\LogFiles
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_07/Add-MailboxDatabaseCopy.ps1
Add-MailboxDatabaseCopy.ps1
Add-MailboxDatabaseCopy -Identity DB01 -MailboxServer AMS-EXCH02 -ReplayLagTime 00:10:00 -TruncationLagTime 4.7:36:00 -ActivationPreference 2
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_07/Search-Mailbox.ps1
Search-Mailbox.ps1
Search-Mailbox "Discovery Search Mailbox" -SearchQuery "Welcome" -TargetMailbox "Kim Akers" -TargetFolder "Recovered Messages" -LogLevel Full -DeleteContent
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_07/New-RetentionPolicy.ps1
New-RetentionPolicy.ps1
New-RetentionPolicy "My Exchange 2013 Policy" -RetentionPolicyTagLinks "Default 2 years move to archive","Delete after 14 days"
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_07/New-RetentionPolicyTag.ps1
New-RetentionPolicyTag.ps1
New-RetentionPolicyTag -Name "Delete after 14 days" -Type Personal -RetentionAction DeleteAndAllowRecovery -AgeLimitForRetention 14 -Comment "Items with this tag will be deleted after 14 days"
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_07/Get-MailboxStatistics.ps1
Get-MailboxStatistics.ps1
Get-MailboxStatistics -Database "MDB01 Recovery" | select DisplayName,ItemCount | ft -a
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_07/New-MailboxExportRequest.ps1
New-MailboxExportRequest.ps1
New-MailboxExportRequest -Mailbox "Discovery Search Mailbox" -SourceRootFolder "Kim Akers" -ContentFilter {Subject -eq "Welcome"} -FilePath \\AMS-FS01\HelpDeskPst\KimAkersRecovery.pst
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_07/New-MailboxImportRequest.ps1
New-MailboxImportRequest.ps1
New-MailboxImportRequest -Mailbox Joe@contoso.com -FilePath \\AMS-FS01\PSTFiles\Archive2011.pst -IsArchive
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_07/Set-MailboxRetention.ps1
Set-MailboxRetention.ps1
Set-Mailbox -Identity joe@contoso.com -RetentionPolicy "My Exchange 2013 Policy"