# UseDefaultCredentials option is not working powershell 4.0

**URL:** <https://forums.powershell.org/t/usedefaultcredentials-option-is-not-working-powershell-4-0/14643>\
**Category:** PowerShell Help\
**Created:** [July 9, 2020, 12:36am UTC](https://forums.powershell.org/t/usedefaultcredentials-option-is-not-working-powershell-4-0/14643 "2020-07-09T00:36:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adityareyan](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@adityareyan](https://forums.powershell.org/u/adityareyan)\
**Post date:** [July 9, 2020, 12:36am UTC](https://forums.powershell.org/t/usedefaultcredentials-option-is-not-working-powershell-4-0/14643/1 "2020-07-09T00:36:44Z")

</div>

Hi,

I’m trying to invoke API call with below command but getting unauthorized error 401 in one of the server. it’s working in another server with same configuration. is there any way to debug why windows not able to use default credentials

```
Invoke-RestMethod-uri "http://site"-UseDefaultCredential
```

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:29pm UTC](https://forums.powershell.org/t/usedefaultcredentials-option-is-not-working-powershell-4-0/14643/2 "2024-05-16T20:29:17Z")

</div>


