Thanks anyways,
I have resolved the issue.
Its because the WMI services and its dependent SMS agent host services were not working properly. so restarted the services and ran the script it worked fine.
If anyone has the same issue you can resolve it by this way.
|