This file contains hidden or 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
| <?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> |
This file contains hidden or 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
| Sub AddRecordToTable() | |
| Set 購入リストテーブル = Worksheets("購入").ListObjects("購入リストテーブル") | |
| With 購入リストテーブル.ListRows.Add | |
| .Range(1).Value = "商品名" | |
| .Range(2).Value = "100" | |
| .Range(3).Value = "3" | |
| .Range(4).Value = "300" | |
| End With | |
| End Sub |
This file contains hidden or 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
| Sub GetTableInformation() | |
| Set 購入リストテーブル = Worksheets("購入").ListObjects("購入リストテーブル") | |
| For i = 1 To 購入リストテーブル.ListRows.Count | |
| 商品名 = 購入リストテーブル.ListColumns("商品名").DataBodyRange(i) | |
| Debug.Print 商品名 | |
| 単価 = 購入リストテーブル.ListColumns("単価").DataBodyRange(i) | |
| Debug.Print 単価 | |
This file contains hidden or 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
| # Exchange OnlineへのPowerShell接続(※多要素認証には非対応) | |
| # | |
| # 1. O365組織の管理者のIDとパスワードを生で記載する | |
| # 2. 管理者として実行したPowerShellに貼り付ける | |
| # 3. 作業する | |
| # 4. 作業が終わったら Remove-Session $Session を実行する | |
| # | |
| # 参考:https://docs.microsoft.com/ja-jp/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps | |
| Set-ExecutionPolicy RemoteSigned |
This file contains hidden or 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
| $users = Get-ADUser -Filter * -Properties displayNamePrintable, DisplayName, mail | |
| $displayNamePrintables = $users.displayNamePrintable | |
| $duplicateUsers = $displayNamePrintables | Where-Object {if(($displayNamePrintables -eq $_).count -ge 2){$_}} | Sort-Object | Get-Unique | |
| Write-Output "表示名 `t DisplayNamePrintable `t メールアドレス" | |
| foreach($user in $users) | |
| { | |
| $duplicateUsers | ForEach-Object { | |
| if($user.displayNamePrintable -eq $_) |
This file contains hidden or 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
| #---------------------------------------------------------- | |
| #設定 | |
| #---------------------------------------------------------- | |
| #スクリプトパス | |
| $scriptPath = "" | |
| #サブスクリプション名 | |
| $subscriptionName = "" | |
| #リージョン |
This file contains hidden or 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
| workflow StopAllVMs | |
| { | |
| $azureCredential = Get-AutomationPSCredential -Name "Default Automation Credential" | |
| # Connect to Azure | |
| Add-AzureAccount -Credential $azureCredential | Write-Verbose | |
| # Select the Azure subscription | |
| $SubscriptionName = 'xxx Subscription Name xxx' | |
| Select-AzureSubscription -SubscriptionName $SubscriptionName |
This file contains hidden or 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
| require 'flickraw' | |
| FlickRaw.api_key="" | |
| FlickRaw.shared_secret="" | |
| flickr.access_token = "" | |
| flickr.access_secret = "" | |
| # From here you are logged: | |
| login = flickr.test.login |
This file contains hidden or 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
| Param | |
| ( | |
| [String]$Path = (Get-Location) | |
| ) | |
| # Elevate | |
| Write-Host "Checking for elevation... " -NoNewline | |
| $CurrentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent()) | |
| if (($CurrentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)) -eq $false) { | |
| ArgumentList = "-noprofile -noexit -file `"{0}`" -Path `"$Path`"" |
This file contains hidden or 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
| do while WScript.Arguments.Count=0 and WScript.Version>=5.7 | |
| 'Run this script as admin. | |
| Set sha=CreateObject("Shell.Application") | |
| sha.ShellExecute "wscript.exe",""""+WScript.ScriptFullName+""" uac","","runas" | |
| WScript.Quit | |
| loop | |