Advertisement
Guest User

Untitled

a guest
May 29th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. Script MsmqStoragePath
  2. {
  3. DependsOn = '[File]MSMQDirectories'
  4. GetScript = {
  5. $manager = Get-MsmqQueueManager
  6. return @{
  7. Result = $manager
  8. GetScript = $GetScript
  9. TestScript = $TestScript
  10. SetScript = $SetScript
  11. }
  12. }
  13. TestScript = {
  14. $manager = Get-MsmqQueueManager
  15. $expectedStoreLocation = 'E:\msmq'
  16. $shouldRun = ($manager.MessageStoreLocation -eq $expectedStoreLocation)`
  17. -and ($manager.MessageLogStoreLocation -eq $expectedStoreLocation)`
  18. -and ($manager.TransactionLogStoreLocation -eq $expectedStoreLocation)
  19. return $shouldRun
  20. }
  21. SetScript = {
  22. takeown /F 'E:\msmq' /R /D y #this should give me ownership of both msmq and LQS folder
  23. icacls 'E:\msmq' /reset /T /C
  24. icacls 'E:\msmq' "/grant:r" "NT AUTHORITY\NetworkService:(OI)(CI)(M)" /T /C
  25. $ConfirmPreference = 'None' # Make sure you don't get a prompt, even when testing
  26. Set-MsmqQueueManager -MsgStore 'E:\msmq' -MsgLogStore 'E:\msmq' -TransactionLogStore 'E:\msmq' -MessageQuota 10097152 #10gb
  27. # Make sure the service is up.
  28. Start-Service msmq
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement