@Sebastian-Roth This is what I’m doing to fix the problem via the api, which seems to work most of the time. A couple times either the fogservice or my code caused the host to stop showing up in the api/gui list of hosts but the host would still be in the database. When that happens I have to reset the host encryption fields and the pending field in the database hosts table for each affected host and then restart the fog service on the host and it shows back up again. below is powershell code $mac = get-activeMacAddress; #function that filters output of get-netadapter to the currently active adapter's mac $hostObj = Get-FogHost -macAddr $mac; #function from fogapi module can be found here https://github.com/darksidemilk/FogApi/blob/master/FogApi/Public/Get-FogHost.ps1 if ($hostObj.pending -ne '0') { Write-Warning "The host is pending or not explicitly set to not pending in fog, adjust host to be approved"; Reset-HostEncryption -fogHost $hostObj; #function from fogapi module that resets the encryption fields of a host see https://github.com/darksidemilk/FogApi/blob/master/FogApi/Public/Reset-HostEncryption.ps1 Set-FogOU -hostObj $hostObj -force; #custom internal function, will share applicable contents below } this is what Set-FogOU does function Set-FogOU { <# .SYNOPSIS Set the proper OU on the fog host based on the hostname and group membership .DESCRIPTION Gets the current fog host infomration and then uses get-oustr to get the OU it should be in based on group membership and the hostname .PARAMETER jsonData The jsondata string used to set the ou with the fog api .PARAMETER hostObj the hostobject of the foghost gotten from get-foghost .PARAMETER OUstr The optional prewritten fogstr if you want to provide it #> [CmdletBinding()] param ( [string]$jsonData, $hostObj, [string]$OUstr, $progressID=1, $parentID=-1, [switch]$force ) process { if($null -eq $hostObj) { Write-Verbose 'no host given, getting current host...'; $mac = Get-ActiveMacAddress $hostObj = Get-FogHost -macAddr $mac } Write-Verbose 'getting fog group...'; $group = Get-FogGroup $hostObj.id; #function from fogapi see https://github.com/darksidemilk/FogApi/blob/master/FogApi/Public/Get-FogGroup.ps1 $OUstr = Get-OUStr -group $group -compName $hostObj.Name; #function that creates correct OUstring from the group name $ADPass = ""; #edited for privacy, this is gotten with powershell pscredential encryption methods Write-Verbose "OU string is $OUstr, setting to properties of host object, also enabling and enforcing domain join..."; $hostObj.ADDomain = "domain"; #edited for privacy $hostObj.ADUser = "domainUser"; #edited for privacy $hostObj.ADPass = $ADPass; $hostObj.ADOU = $OUstr; $hostObj.useAD = 1; $hostObj.enforce = 1; $hostObj.pending = '0'; #made it a string instead of an int as it seemed to make a difference Write-Verbose 'creating json string from new host ou settings...'; $jsonData = $hostObj | Select-Object id,ADDomain,ADUser,ADPass,ADOU,useAD,enforce,pending | ConvertTo-Json; Update-FogObject -type object -coreObject host -IDofObject $hostObj.id -jsonData $jsonData; #fogapi function to run the update/set api command } Basically just doing a PUT api command on the host object to reset the encryption fields and then another one to set the pending field to '0' and to put all the OU settings back. The json created by the command defining $jsonData looks like this (slightly edited for privacy) { "id": "1593", "ADDomain": "domain", "ADUser": "domainUser", "ADPass": "secretPassword", "ADOU": "OU=IT,OU=Workstations,DC=domainName,DC=com", "useAD": 1, "enforce": 1, "pending": "0" }