qshinoの日記

Powershell関係と徒然なこと

2017-03-11から1日間の記事一覧

iosでバッククオート入力

ios

iPhoneでバッククオート iPhoneやiPadなどのiOSデバイスのソフトキーで入力に困った文字について。 iosのソフトキーボードには、バッククオートが表示されない。実は、シングル・クオート長押しで出てくる。 長押しで出てくる文字は他にもあるので、皆さんも…

windows ファイル権限

PC

Windows ACL icacls 省略形 icacls [file] /grant : 詳細 icacls <FileName> [/grant[:r] <Sid>:<Perm>[...]] [/deny <Sid>:<Perm>[...]] [/remove[:g|:d]] <Sid>[...]] [/t] [/c] [/l] [/q] [/setintegritylevel <Level>:<Policy>[...]] icacls <Directory> [/substitute <SidOld> <SidNew> [...]] [/restore <ACLfile> [/c] [/…</aclfile></sidnew></sidold></directory></policy></level></sid></perm></sid></perm></sid></filename>

sha1 ハッシュ

$enc = [system.Text.Encoding]::UTF8 $string1 = "This is a string to hash" $data1 = $enc.GetBytes($string1) # Create a New SHA1 Crypto Provider $sha = New-Object System.Security.Cryptography.SHA1CryptoServiceProvider # Now hash and display …

des暗号 by powershell

des暗号化 by powershell Powershell のSecureStringはそのマシンのそのユーザーでしか復号できないので可搬性がない。 そこで、可搬性のある暗号化 # 変数定義 $inPath = "F:\Desktop\myTest.txt" $encPath = "F:\Desktop\Enc.txt" $decPath = "F:\Desktop\…

ウインドウ機能インストール by Powershell

Install-WindowsFeature import-module servermanager Get-WindowsFeature で確認し、 Install-WindowsFeature -Name xx -IncludeManagementTools -Restart -LogPath でインストール Add-WondowsFeatureは、Install-xx のAlias 参考 Technet https://technet…

ディレクトリコピー

PC

ディレクトリの再帰的コピー xcopy /S /E /F /G /H /R /K /Y SOURCE DESTINATION 参考 http://sonic64.com/2006-04-13.html

フォルダパーミッション

フォルダパーミッション設定 by powershell 基本操作は、acl取得、変更、acl設定。 実施例) 継承無効化 $folder = 'c:\tmp\myfolder' $acl = Get-Acl $folder $acl.SetAccessRuleProtection($true,$true) $acl | Set-Acl $folder 継承付きでフルコントロール…

IIS-FTP userisolation by Powershell

PowerShellによるIIS FTPサイト構築 前提 ユーザー分離はvdir非共有 $iso=3 Read/Write可 Win2012R2以降 情報取得 ls IIS:\ ls IIS:Sites\ ls IIS:\Sites\xx $site = Get-Item IIS:\Sites\xx $site $ftp = Get-WebConfiguration -pspath IIS:\Sites\xx $ftp …