Skip to main content

Notifications

Community site session details

Community site session details

Session Id : i/VATbaRuhekk0xCLz1JZU
Power Apps - Power Query
Suggested answer

Chrome Policy Error

Like (2) ShareShare
ReportReport
Posted on 21 Feb 2025 15:04:07 by 2
Getting a Chrome Policy error "Expected string value" when using the "DefaultPrinterSelection" entry in policies.json
 
My policies file entry is...
 
{
"namePattern": {
   "description": "Printernamehere",
   "type": "string"
  }
 },
 
Categories:
  • KM-21021458-0 Profile Picture
    2 on 24 Feb 2025 at 13:18:25
    Chrome Policy Error
    Hi Ravi
     
    Many thanks for response
    I was following the guide here which doesn't mention any array requirement
     
     
    However I have now found syntax which appears to fulfil my requirements and sets the default printer to one of my choosing by setting the policies.json entry as follows:
     
    {
            "DefaultPrinterSelection": "{ \"namePattern\": \"Printernamehere\" }"
    }

     
     
     
  • Suggested answer
    Ravi-Prajapati Profile Picture
    409 on 22 Feb 2025 at 06:40:00
    Chrome Policy Error

    The error "Expected string value" in your policies.json file suggests that there is a formatting issue with the "DefaultPrinterSelection" entry. The structure of the policy might be incorrect.

    Correct Format for DefaultPrinterSelection

    The Google Chrome Enterprise policies documentation specifies that DefaultPrinterSelection should be an array of objects, with each object containing a "namePattern" key and a string value. Here's the correct structure:

     
    {
    "DefaultPrinterSelection": [
    {
    "namePattern": "Printernamehere"
    }
    ]
    }

    Issues with Your JSON

    Your original JSON appears to be incorrect because:

    1. The key "DefaultPrinterSelection" is missing.
    2. "namePattern" should be inside an array as part of DefaultPrinterSelection.
    3. The "type": "string" and "description" keys are unnecessary in policies.json.

    Steps to Fix

    1. Replace your current policies.json entry with the correctly formatted JSON above.
    2. Ensure the file is valid JSON (you can use an online JSON validator like jsonlint.com).
    3. Restart Chrome or enforce the policy using:
      • On Windows: Run gpupdate /force (if managed via Group Policy).
      • On Mac/Linux: Restart Chrome.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Query

#1
ronaldwalcott Profile Picture

ronaldwalcott 2

Overall leaderboard

Featured topics

Loading started