This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Remote Desktop ServiceのRDP-Tcp Connectionにあるアカウントを削除します。 | |
.PARAMETER AccountName | |
対象となるアカウント名を指定します。 | |
.PARAMETER TerminalName | |
対象となるターミナル名を設定します。通常は"RDP-Tcp"が指定されます。 | |
.PARAMETER ComputerName | |
対象となるコンピューター名を設定します。未指定の場合は現在のコンピューター名が対象になります。 | |
.PARAMETER Credential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
コマンドを検索し文字列形式で返します。 | |
.DESCRIPTION | |
コマンドを検索し文字列形式で返します。 | |
Get-Commandコマンドレットのラッパーになります。 | |
返される文字列の形式は "[コマンドの種別] : [名称およびPath]"になります。 | |
.PARAMETER Name | |
検索する名称を指定します。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Windows10で暗いテーマカラーを使用するか否かを設定します。 | |
.DESCRIPTION | |
設定メニューなどのダイアログは通常明るいテーマ色に設定されていますが、 | |
このファンクションを使うことで"暗い"テーマ色にすることができます。 | |
.PARAMETER Enabled | |
$trueを設定すると"暗い"テーマ色にします。 | |
$falseを設定すると通常のテーマ色に戻します。 | |
.EXAMPLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Install ADDS/GPMC/RSAT(ADTools) Components | |
# | |
Add-WindowsFeature AD-Domain-Services, GPMC, RSAT-ADDS, RSAT-AD-PowerShell | |
# | |
# Install New Domain Controller | |
# | |
Import-Module ADDSDeployment | |
$DomainName = "contoso.local" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module ADDSDeployment | |
# Demote domain controller | |
$DomainName = "contoso.local" | |
$Cred = New-Object PSCredential "administrator@$DomainName",(ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force) | |
$Params = @{ | |
LocalAdministratorPassword = (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force); | |
DemoteOperationMasterRole = $true; | |
RemoveDnsDelegation = $true; | |
DnsDelegationRemovalCredential = $Cred; | |
Confirm = $false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################################################################### | |
## Copyright(c) Oracle Corporation 1998,2015. All rights reserved.## | |
## ## | |
## Specify values for the variables listed below to customize ## | |
## your installation. ## | |
## ## | |
## Each variable is associated with a comment. The comment ## | |
## can help to populate the variables with the appropriate ## | |
## values. ## | |
## ## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM | |
REM Windows Defenderの定義更新を定期的に行うタスクを登録するスクリプト | |
REM schtasksコマンドを使用したバージョン | |
REM ※要管理者権限 | |
REM Windows 7で動作確認しています。 | |
REM | |
schtasks.exe /Create /RU system /SC HOURLY /TN "Windows Defender Update" /TR "'C:\Program Files\Windows Defender\MpCmdRun.exe' -SignatureUpdate -MMPC" /ST "01:00:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 4.0 | |
<# | |
.SYNOPSIS | |
指定したファイルのハッシュ値を検証します。 | |
.DESCRIPTION | |
指定したファイルのハッシュ値を-Hashパラメーターで指定された値と比較し、同一であれば$Trueを返します。 | |
.PARAMETER Path | |
ハッシュ値を検証するファイル名を指定します。 | |
.PARAMETER Hash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 文字列置換時にコールバックを使う | |
$RegEx = [Regex]"\p{IsHiragana}" | |
$RegEx.Replace("ざっくりひらがなをカタカナに変換する。", { [char]([int]($args[0].value[0])+0x60) } ) | |
# | |
# 変換結果 → ザックリヒラガナヲカタカナニ変換スル。 | |
# | |
# -Replace演算子ではスクリプトブロックを指定できたもののコールバックは使えなかった | |
# 単純にToStringした結果を渡してるだけっぽい。 | |
"ざっくりひらがなをカタカナに変換する。" -replace "(?<kana>\p{IsHiragana})", { [char]([int](${kana})+0x60) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ./guest_network.rb.orig 2015-01-06 13:42:26.000000000 +0900 | |
+++ ./guest_network.rb 2015-01-21 11:40:38.341846700 +0900 | |
@@ -40,8 +40,8 @@ | |
def configure_dhcp_interface(nic_index, net_connection_id) | |
@logger.info("Configuring NIC #{net_connection_id} for DHCP") | |
if !is_dhcp_enabled(nic_index) | |
- netsh = "netsh interface ip set address \"#{net_connection_id}\" dhcp" | |
- @communicator.execute(netsh) | |
+ command = "&{exit (Get-WMiObject Win32_NetworkAdapterConfiguration -Filter \"Index=#{nic_index}\").EnableDHCP().ReturnValue}" | |
+ @communicator.execute(command) |