10 Replies Latest reply on Jun 15, 2017 7:53 AM by Bill Robinson

    How to create compliance rule for Page file?

      I want to create the rule for page file check for windows box in BL ? Can we have any system object value for this or have to get this something via vb / powershell?

       

       

      Scenario:--

       

      The Page File on drive C: should be set to Initial size=2Mb  and Maximum size=2Mb

        • 1. Re: How to create compliance rule for Page file?
          Siddu angadi

          Import the attached file  into Component template within BL Console and try to run compliance job against any windows box:

           

          Thanks

          Siddu

          • 2. Re: How to create compliance rule for Page file?
            Siddu angadi

            Sorry Ignore the last attachment.

             

            I have now attached right one, which is basically check for Page file size initial 2048 KB and Max 2048 MB.

             

            Import the attached and test it.

            • 3. Re: How to create compliance rule for Page file?

              Thanks for your help.. but i think i have a different use case here

               

              Question : Is it possible if can achieve this rule without vbscript??

               

               

              Scenario:---

               

               

              • The Page File on drive C: should be set to Initial size=2Mb and Maximum size=2Mb
              • It is recommended that where possible that an additional Paging file is created on drive D:
              • The Page File on drive D: should be set to Initial size=2 * installed RAM  and Maximum size=2 * installed RAM
              • If the physical memory is greater than 2Gb then the file should be split over 2 disks

               

               

              for this i created the below script like that

               

               

              Dim RetrievedValue, Element, FoundC

              strComputer = "."

              Set objWMIService = GetObject("winmgmts:" _

                  & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

               

               

              Set colPageFiles = objWMIService.ExecQuery _

                  ("Select * from Win32_PageFileSetting")

               

               

               

               

              For Each Element in colPageFiles

                                                                          If Left(ucase(Element.Name),3)="C:\" Then

                                                                                    RetrievedValue = "[Initial Size=" & Element.InitialSize & "Mb , Maximum Size=" & Element.MaximumSize & "Mb]"

                                                                                    FoundC = True

                                                                                    Exit For

                                                                                    Wscript.Echo " PageFileSize: " & RetrievedValue

                                                                          End If

                                                                Next

                                                                Set colPageFiles = Nothing

               

                                                                If FoundC = False Then

                                                                          RetrievedValue = "Not_Found"

                                                                          Wscript.Echo " PageFileSize: " & RetrievedValue

                                                                End If

              • 4. Re: How to create compliance rule for Page file?
                Siddu angadi

                Hi,

                 

                Yes, you have to write custom VBScript or powershell in comibination with NSH to achiev your requirement.

                 

                Thanks

                Siddu

                • 5. Re: How to create compliance rule for Page file?

                  I tried but not able to create VB Script for my compliance rule mentioned above. Any help for the vb scrpt here?

                   

                   

                  Scenario:---

                   

                   

                  • The Page File on drive C: should be set to Initial size=2Mb and Maximum size=2Mb
                  • It is recommended that where possible that an additional Paging file is created on drive D:
                  • The Page File on drive D: should be set to Initial size=2 * installed RAM  and Maximum size=2 * installed RAM
                  • If the physical memory is greater than 2Gb then the file should be split over 2 disks
                  • 6. Re: How to create compliance rule for Page file?
                    Bill Robinson

                    i think you could also look in the registry for this and use the native blade object:

                     

                    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PagingFiles

                     

                    also - where are you getting the recommendation to split the page file ? 

                    • 7. Re: How to create compliance rule for Page file?
                      Jim Wilson

                      @Raj,

                       

                      Did this get resolved?

                      If so, please can you update the discussion thread with details so that is can be marked as answered.

                       

                      Thanks & Regards,

                      Jim (Forum Manager/Facilitator)

                      • 8. Re: How to create compliance rule for Page file?

                        Yes , it is resolved and marked as answered .. but got it only checking page file in c: drive only

                        • 9. Re: How to create compliance rule for Page file?
                          Rajamuthu Sundaram

                          Hi

                           

                          i am creating pagefile compliance with below scenario, could you please help me on this.

                          My requirement

                          1. Read phsyical memory

                          2.if physical memory <=4000 Then page file should be RAM*1,5

                          3.if physical memory >4000 and total RAM<16000 then page file should be 8 GB

                          else it should report non-compliance. please help me to configure it

                          • 10. Re: How to create compliance rule for Page file?
                            Bill Robinson

                            so what have you tried to do so far?

                             

                            1. Read phsyical memory

                            so where can you get this info ?  from a native object in bsa (like hardware info) ?  by running a command ? (nmem)  something else ?

                             

                            you are missing a step - how do you get the value of the page file size?  registry setting?  something else ?

                             

                             

                            2.if physical memory <=4000 Then page file should be RAM*1,5

                            ok, so you need to do some math here in your rule right ?

                             

                             

                            3.if physical memory >4000 and total RAM<16000 then page file should be 8 GB

                            so this one seems straightforward if you know how much memory the box has and where to get the page file size right ?