Skip to content

Instantly share code, notes, and snippets.

View ebibibi's full-sized avatar

Masahiko Ebisuda ebibibi

View GitHub Profile
@ebibibi
ebibibi / boxstarter.txt
Last active November 27, 2021 23:35
boxstarter for ebi
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
Disable-UAC
cinst git
cinst vscode
cinst python
@ebibibi
ebibibi / YoutubeIndexFromPremiereMarker.ps1
Created October 25, 2021 02:42
Adobe Premiereのマーカーをエクスポートしたテキストファイルを元にYoutubeのインデックスを作成するPowerShellスクリプト
$targetFileName = "Ending_60p.txt"
$desktop = [Environment]::GetFolderPath("Desktop")
$targetFile = Join-Path $desktop $targetFileName
if(!(Test-Path $targetFile)) {
Write-Host "$targetFile が存在しませんでした"
exit
}
Write-Host "Outlookを終了します。"
taskkill /IM outlook.exe
Write-Host "Teamsを終了します。"
Get-Process | Where-Object {$_.ProcessName -eq "Teams"} | Stop-Process
Write-Host "5秒待ちます"
Start-Sleep 5
Write-Host "Teamsのキャッシュファイルを削除します。"
@ebibibi
ebibibi / installMMAAgent.ps1
Created July 6, 2021 04:16
sample code for install MMA agent to windows server silently
param (
[Parameter(mandatory=$true)] $MMAInstallerURI,
[Parameter(mandatory=$true)] $WorkSpaceID,
[Parameter(mandatory=$true)] $Key
)
#donwload
Invoke-WebRequest -UseBasicParsing -URI $MMAInstallerURI -OutFile .\MMASetup-AMD64.exe
#extract
Sub 部署名変更bySubscriptionGUID(ByVal guid As String, ByVal newDepartment As String)
Dim detailTable
Set detailTable = Worksheets("データソースfromAzure(detail)").ListObjects("detail")
For i = 1 To detailTable.ListRows.Count
If detailTable.ListColumns("サブスクリプション GUID (SubscriptionGuid)").DataBodyRange(i) = guid Then
detailTable.ListColumns("部署名 (Department Name)").DataBodyRange(i).Value = newDepartment
End If
Next
{
"mode": "All",
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Network/networkSecurityGroups/securityRules"
},
{
@ebibibi
ebibibi / SetAllMaiboxToJapanese.ps1
Created October 9, 2019 03:07
Set all mailboxes to Japanese language.
Connect-EXOPSSession
Get-Mailbox | ForEach-Object { Set-MailboxRegionalConfiguration -Identity $_.displayname -DateFormat "yyyy/MM/dd" -TimeFormat "H:mm" -TimeZone "Tokyo Standard Time" -LocalizeDefaultFolderName:$True -Language "ja-JP"}
#予め Connect-EXOPSSession で接続しておく
function AddUserPermissionToShareMailboxByGroup([string]$shareMailbox, [string]$group)
{
Write-Host "Get-DisributionGroup"
Write-Host "group is $group"
$members = Get-DistributionGroupMemberRecursivery $group
foreach($member in $members)
{
Windows Registry Editor Version 5.00
;CapsLockを右Ctrlにする
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map" = hex:00,00,00,00, 00,00,00,00, 02,00,00,00, 1D,E0,3A,00, 00,00,00,00
@ebibibi
ebibibi / untitled.xml
Created September 2, 2019 01:04
Sample answer file for sysprep of Windows Server 2019(Japanese)
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<OOBE>
<HideEULAPage>true</HideEULAPage>
</OOBE>
<UserAccounts>
<AdministratorPassword>
<Value>SampleP@ssw0rd</Value>