Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Script MsmqStoragePath
- {
- DependsOn = '[File]MSMQDirectories'
- GetScript = {
- $manager = Get-MsmqQueueManager
- return @{
- Result = $manager
- GetScript = $GetScript
- TestScript = $TestScript
- SetScript = $SetScript
- }
- }
- TestScript = {
- $manager = Get-MsmqQueueManager
- $expectedStoreLocation = 'E:\msmq'
- $shouldRun = ($manager.MessageStoreLocation -eq $expectedStoreLocation)`
- -and ($manager.MessageLogStoreLocation -eq $expectedStoreLocation)`
- -and ($manager.TransactionLogStoreLocation -eq $expectedStoreLocation)
- return $shouldRun
- }
- SetScript = {
- takeown /F 'E:\msmq' /R /D y #this should give me ownership of both msmq and LQS folder
- icacls 'E:\msmq' /reset /T /C
- icacls 'E:\msmq' "/grant:r" "NT AUTHORITY\NetworkService:(OI)(CI)(M)" /T /C
- $ConfirmPreference = 'None' # Make sure you don't get a prompt, even when testing
- Set-MsmqQueueManager -MsgStore 'E:\msmq' -MsgLogStore 'E:\msmq' -TransactionLogStore 'E:\msmq' -MessageQuota 10097152 #10gb
- # Make sure the service is up.
- Start-Service msmq
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement