# Custom DSC resource not recognized 

**URL:** <https://forums.powershell.org/t/custom-dsc-resource-not-recognized/3055>\
**Category:** DSC\
**Created:** [September 3, 2014, 10:03pm UTC](https://forums.powershell.org/t/custom-dsc-resource-not-recognized/3055 "2014-09-03T22:03:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mayuri-naware](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@mayuri-naware](https://forums.powershell.org/u/mayuri-naware)\
**Post date:** [September 3, 2014, 10:03pm UTC](https://forums.powershell.org/t/custom-dsc-resource-not-recognized/3055/1 "2014-09-03T22:03:57Z")

</div>

Hi,

I tried creating the custom resource by following the blog using XDscResourceDesigner  
[http://blogs.msdn.com/b/powershell/archive/2013/11/19/resource-designer-tool-a-walkthrough-writing-a-dsc-resource.aspx](http://blogs.msdn.com/b/powershell/archive/2013/11/19/resource-designer-tool-a-walkthrough-writing-a-dsc-resource.aspx)

I am able to import the module but when I run the Get-DscResource then I am getting follwing error ::

CheckResourceFound : The term ‘AppPoolServiceAccount’ is not recognized as the name of a Resource.  
At  
C:\windows\system32\windowspowershell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:2264  
char:13

- 

```
        CheckResourceFound $name $resources

```

- 

```
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

```

  - CategoryInfo : NotSpecified: (🙂 [Write-Error], WriteErrorException
  - FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,CheckResourceFound

I have also checked the folder structure it is as below:

C:\Program Files\Windows Powershell\Modules  
|  
|(Folder)  
|  
ResourceName.psd1(File)  
|(Folder)  
|  
|(Folder)  
|  
.psm1 (file)  
.schema.mof (file)

Any Help is appreciated 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [September 3, 2014, 10:29pm UTC](https://forums.powershell.org/t/custom-dsc-resource-not-recognized/3055/2 "2014-09-03T22:29:24Z")

</div>

I think your original post might have contained angle brackets, which the forum software currently eats and tries to process as HTML. Here’s what the folder structure should look like:

```
C:\Program Files\WindowsPowerShell\Modules\ModuleName
                                                     \ModuleName.psd1
                                                     \DSCResources
                                                                  \ResourceModuleName
                                                                                     \ResourceModuleName.psm1
                                                                                     \ResourceModuleName.schema.mof
```

ModuleName and ResourceModuleName can be anything you like, so long as they match up between the folders and files. The schema.mof file will typically assign a friendly name to your classes so people don’t have to remember something like PSHOrg\_cSmbShare.

---

<div class="post-metadata">

**Author:** ![mayuri-naware](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@mayuri-naware](https://forums.powershell.org/u/mayuri-naware)\
**Post date:** [September 3, 2014, 10:42pm UTC](https://forums.powershell.org/t/custom-dsc-resource-not-recognized/3055/3 "2014-09-03T22:42:37Z")

</div>

Thanks for the reply ,

The folder structure is same as that you mentioned but path to the Modules folder is C:\Program Files\WindowsPowerShell\Modules and this path is included in the PSModulePath.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [September 3, 2014, 11:50pm UTC](https://forums.powershell.org/t/custom-dsc-resource-not-recognized/3055/4 "2014-09-03T23:50:47Z")

</div>

Whoops, you’re right. I had “WindowsPowerShell” on the brain and wound up typing “Windows\PowerShell” 🙂 I’ll fix the previous post.

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [September 4, 2014, 12:43am UTC](https://forums.powershell.org/t/custom-dsc-resource-not-recognized/3055/5 "2014-09-04T00:43:13Z")

</div>

Also, check out the DSC Resource Kit modules - they exhibit the correct structure, and it might be easier to see it right on your own system.

---

<div class="post-metadata">

**Author:** ![windows-liveuser78](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/windows-liveuser78/32/702_2.png) [@windows-liveuser78](https://forums.powershell.org/u/windows-liveuser78)\
**Post date:** [September 4, 2014, 4:45am UTC](https://forums.powershell.org/t/custom-dsc-resource-not-recognized/3055/6 "2014-09-04T04:45:23Z")

</div>

I don’t know what your module name is, but it looks like your resource is named AppPoolServiceAccount. So your directory structure should look like this:

```
C:\Program Files
+ WindowsPowerShell
  + Modules
    + ModuleName
      * ModuleName.psm1
      + DSCResources
        + AppPoolServiceAccount
          * AppPoolServiceAccount.psm1
          * AppPoolServiceAccount.schema.mof
```

Have you imported your resource in your configuration block?

```
Import-DscResource -ModuleName 'ModuleName' -Name '*' # I've never been able to import specific resources with Import-DscResource
```

What is the name of your resource in its schema.mof file? If it isn’t the same as in the file system, it won’t load. I don’t remember if it is the same error you’re getting, though.

```
[ClassVersion("1.0.0.0"), FriendlyName("AppPoolServiceAccount")]
class AppPoolServiceAccount: OMI_BaseResource
{
;
```

---

<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, 9:18pm UTC](https://forums.powershell.org/t/custom-dsc-resource-not-recognized/3055/7 "2024-05-16T21:18:43Z")

</div>


