def LocateWebServerPath(description):
 assert (len(description) >= 1), 'Server name or comment is required'
 iis = GetObject(_IIS_OBJECT)
 description = description.lower().strip()
 for site in iis:
  site_attributes = [getattr(site, attr, '').lower().strip() for attr in ('Name', 'ServerComment')]
  if (description in site_attributes):
   return site.AdsPath
 msg = ("No web sites match the description '%s'" % description)
 raise ItemNotFound(msg)

def LocateWebServerPath ( description ) : assert ( len ( description ) >= 1 ) , 'Server name or comment is required' iis = GetObject ( _IIS_OBJECT ) description = description . lower ( ) . strip ( ) for site in iis : site_attributes = [ getattr ( site , attr , '' ) . lower ( ) . strip ( ) for attr in ( 'Name' , 'ServerComment' ) ] if ( description in site_attributes ) : return site . AdsPath msg = ( "No web sites match the description '%s'" % description ) raise ItemNotFound ( msg )
find an iis web server whose name or comment matches the provided description .