[PS] Enabling and disabling "Default Indexed Paths" and "Default Excluded Paths" policies
HI
Using PowerShell, how do I enable and disable, for all users, the "Default Indexed Paths" and "Default Excluded Paths" policies of Group Policy for Windows Search in Windows 7?
THANKS
BYE
Using PowerShell, how do I enable and disable, for all users, the "Default Indexed Paths" and "Default Excluded Paths" policies of Group Policy for Windows Search in Windows 7?
THANKS
BYE
0 Comments
[ + ] Show comments
Answers (6)
Please log in to answer
Posted by:
anonymous_9363
14 years ago
Posted by:
balubeto
14 years ago
ORIGINAL: VBScab
Since GP settings are recorded in the registry, you should be able to locate a script which will set registry values and edit the keys and values accordingly.
I tried this script:
md "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\DefaultIndexedPaths" -Force
cd "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\DefaultIndexedPaths"
New-ItemProperty . -Name 'file:///Included-directory' -Value 'file:///Included-directory'
md "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\DefaultExcludedPaths"
cd "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\DefaultExcludedPaths"
New-ItemProperty . -Name 'file:///Excluded-directory' -Value 'file:///Excluded-directory'
but does not work because the "Default Indexed Paths" and "Default Excluded Paths" policies are always "not configured". Why?
THANKS
BYE
Posted by:
anonymous_9363
14 years ago
Posted by:
balubeto
14 years ago
Reading [url=http://social.technet.microsoft.com/Forums/en-US/w7itprogeneral/thread/60fdd642-6c2c-493b-887f-6213ca01cfd5]this thread[/url], I assume that the script, reaching my goal, is:
Right?
THANKS
BYE
md "HKLM:\SOFTWARE\Microsoft\Windows Search\CurrentPolicies\DefaultIndexedPaths" -Force
cd "HKLM:\SOFTWARE\Microsoft\Windows Search\CurrentPolicies\DefaultIndexedPaths"
New-ItemProperty . -Name 'file:///<indexing_directory>' -Value 'file:///<indexing_directory>'
md "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\DefaultIndexedPaths" -Force
cd "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\DefaultIndexedPaths"
New-ItemProperty . -Name 'file:///<indexing_directory>' -Value 'file:///<indexing_directory>'
md "HKLM:\SOFTWARE\Microsoft\Windows Search\CurrentPolicies\DefaultExcludedPaths"
cd "HKLM:\SOFTWARE\Microsoft\Windows Search\CurrentPolicies\DefaultExcludedPaths"
New-ItemProperty . -Name 'file:///<not_indexing_directory>' -Value 'file:///<not_indexing_directory>'
md "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\DefaultExcludedPaths"
cd "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\DefaultExcludedPaths"
New-ItemProperty . -Name 'file:///<not_indexing_directory>' -Value 'file:///<not_indexing_directory>'
Right?
THANKS
BYE
Posted by:
balubeto
14 years ago
ORIGINAL: VBScab
Surely the best method for that is to use Group Policy?!? :)
Unfortunately, I have often activate and deactivate these policies on many non-networked computers. So, I decided to create two scripts that respectively enable and disable these two policies. So, anyone have any ideas on how to create these two scripts?
THANKS
BYE
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.